|
pavanbabut wrote: BTW how can we define the low and high addresses or lengths for a 64bit integer while accesses it in 32bit fashion
With the structure I showed as an example you can access them either way - through the dw or the qw members.
The struct will work for both 32 and 64 bit but that doesn't mean that's what the driver vendor
does.
|
|
|
|
|
Why not use
typedef unsigned __int64 uint64;
typedef __int64 int64;
Which gives you easy to use 64 bit types just like unsigned/signed ints of other sizes, and then use unions as shown above to deal with the component parts?
Steve S
Developer for hire
|
|
|
|
|
How can I read a whole line from a text file into a string in C?
|
|
|
|
|
|
|
Hi i would like to ask:
m_Btn (variable for a Button graphic)
how i will say if m_Btn.EnableWindow(TRUE) then return 0
if ( m_Btn.EnableWindow() == TRUE)
{
return 0;
}
?
|
|
|
|
|
<code>
if (m_Btn.IsWindowEnabled())
return 0;
|
|
|
|
|
and how if i want to say is Disable ? :P
(as i see m_Btn.IsWindowDisabled()) doesnt work
|
|
|
|
|
bool disabled = !m_Btn.IsWindowEnabled();
|
|
|
|
|
if ( ! m_Btn.IsWindowEnabled() )
return 0;
|
|
|
|
|
thx
|
|
|
|
|
np, just remember it always tests if it is zero.
|
|
|
|
|
When you run a function see return value if its bool A() you can use for example if (A()) and if(!A())
|
|
|
|
|
Can anybody tell me how to find the system font?
I'm trying to find the font currently associated with a window, MSDN states that if WM_GETFONT returns NULL, then the window is using the system font. But it doesn't tell me how to get a handle to it.
|
|
|
|
|
Nm. I got it sorted. Thanks for the help.
|
|
|
|
|
Well, several days ago I posted a message that the MouseMove was not being captured on a CListCtrl whenever the user was selecting more than one item on a CListCtrl derived class. The replies were basically "it works for me", but no matter how much i tested, it didnt.
The CListCtrl is in large icon view, and I need invalidate a control when the user is selecting various items with the mouse (dragging the mouse).
I'm using this, just to test:
void CMyListCtrl::OnMouseMove(UINT nFlags, CPoint point)
{
if (nFlags & MK_LBUTTON)
ASSERT(FALSE);
CListCtrl::OnMouseMove(nFlags, point);
}
As you could probably test, this is not working. Where can I capture this event?
|
|
|
|
|
This is probably a dumb question and I didn't see your previous post but I'll ask anyway
Is there a ON_WM_MOUSEMOVE() entry in your CMyListCtrl class message map?
Do you get a WM_LBUTTONDOWN message for the control? If so, then maybe the list control has it's
own message loop during dragging operations.
|
|
|
|
|
Yes on both. I think, like you, that the list control has it's own message loop.. but then.. how can I capture this event?
|
|
|
|
|
skullfire wrote: but then.. how can I capture this event?
That would be tough if you want the list control to do its processing at the same time you do
yours. I imagine at WM_LBUTTONDOWN the control is pulling messages straight from the queue
(processing WM_MOUSEMOVE messages) until it receives a WM_LBUTTONUP or when WM_MOUSEMOVE
indicates the button is no longer pressed. You could check if you receive a WM_LBUTTONUP after
a drag operation and possibly handle your stuff there but during the drag I don't think so.
|
|
|
|
|
What could also work for me is if I use an event where I can see if a certain item has changed it's state (LVIS_SELECTED, for instance). Is there an event for this? OnItemChangeState or something?
|
|
|
|
|
From the docs - list view controls WM_LBUTTONDOWN:
"...the list-view control enters a modal message loop until either the button is released or the mouse is moved."
skullfire wrote: What could also work for me is if I use an event where I can see if a certain item has changed it's state (LVIS_SELECTED, for instance). Is there an event for this? OnItemChangeState or something?
LVN_ITEMCHANGING and LVN_ITEMCHANGED are sent to the parent window.
|
|
|
|
|
Damn... that reflect message is called whenever the listCtrl wants to draw itself.. this is no use... this should only be called when an actual state change has occured. Here's my code:
<code>
void CSkinListControl::OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
static int lola = 20;
if( pNMLV->iItem > -1 &&
pNMLV->uChanged & LVIF_STATE && pNMLV->uNewState & (LVIS_SELECTED | LVIS_FOCUSED) )
{
lola--;
}
*pResult = 0;
}
-- modified at 17:34 Wednesday 8th November, 2006
|
|
|
|
|
skullfire wrote: Damn... that reflect message is called whenever the listCtrl wants to draw itself
Hmm. How are you calling OnLvnItemchanged()?
Like this?
BOOL CSkinListControlParent::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
NMHDR *pHdr = (NMHDR *)lParam;
if (wParam == IDC_LISTCTRL)
{
if (pHdr->code == LVN_ITEMCHANGED)
{
OnLvnItemchanged(pHdr, pResult);
return TRUE;
}
}
return CWnd::OnNotify(wParam, lParam, pResult);
}
void CSkinListControlParent::OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLISTVIEW pNMLV = reinterpret_cast(pNMHDR);
static int lola = 20;
if( pNMLV->iItem > -1 &&
pNMLV->uChanged & LVIF_STATE && pNMLV->uNewState & (LVIS_SELECTED | LVIS_FOCUSED) )
{
lola--;
}
*pResult = 0;
}
|
|
|
|
|
CListCtrl does not have it's own message pump. Can you show your message map and handler?
Steve
|
|
|
|
|
Stephen Hewitt wrote: CListCtrl does not have it's own message pump
The underlying common control handles Windows messages though.
|
|
|
|