mattKnight
Programmer
I am trying to use the TrackMouseEvent to initiate WM_NCMOUSEHOVER messages.
Here is the code that I am using to set up the mouse tracking.
If I comment out the TME_NONCLIENT constant, I capture the WM_MOUSEHOVER messages in the message handler and reading back the tracking information into the second udt gives sensible values. However, if I include the TME_NONCLIENT constant in the dwFlags member, I get no messages (either WM_MOUSEHOVER, WM_NCMOUSEHOVER and (if requested) WM_MOUSELEAVE). I also get 0 in the read back UDT.
I am using Windows 2000 and VB6 sp5
Take Care
Matt
If at first you don't succeed, skydiving is not for you.
Here is the code that I am using to set up the mouse tracking.
If I comment out the TME_NONCLIENT constant, I capture the WM_MOUSEHOVER messages in the message handler and reading back the tracking information into the second udt gives sensible values. However, if I include the TME_NONCLIENT constant in the dwFlags member, I get no messages (either WM_MOUSEHOVER, WM_NCMOUSEHOVER and (if requested) WM_MOUSELEAVE). I also get 0 in the read back UDT.
I am using Windows 2000 and VB6 sp5
Code:
'API Declarations
Public Type udtTrackMouseEvent
cbSize As Long
dwFlags As Long
hwndTrack As Long
dwHoverTime As Long
End Type
Public Declare Function TrackMouseEvent Lib "comctl32" Alias "_TrackMouseEvent" (lpEventTrack As udtTrackMouseEvent) As Long
Code:
Private Sub InitMouseTrack(hForm As Long)
Dim udtSetTME As udtTrackMouseEvent, udtReadTME As udtTrackMouseEvent
With udtSetTME
.cbSize = Len(udtSetTME)
.dwFlags = TME_HOVER '+ TME_NONCLIENT
.dwHoverTime = HOVER_DEFAULT
.hwndTrack = hForm
End With
Debug.Print "Setting TrackMouseEvent "; TrackMouseEvent(udtSetTME)
With udtReadTME
.cbSize = Len(udtReadTME)
.dwFlags = TME_QUERY
End With
Debug.Print "Querying TrackMouseEvent "; TrackMouseEvent(udtReadTME)
Debug.Print "Flags "; udtReadTME.dwFlags
Debug.Print "Hover "; udtReadTME.dwHoverTime
Debug.Print "hWnd "; udtReadTME.hwndTrack
End Sub
Take Care
Matt
If at first you don't succeed, skydiving is not for you.