tags:

views:

44

answers:

1

Basically I call TrackMouseEvent in my WM_CREATE then I call it again after a WM_MOUSELEAVE but this freezes up my program. Where should I be sticking it? Thanks

+1  A: 

You need to call TrackMouseEvent when the mouse enters your control, and not when it leaves your control.

You can call TrackMouseEvent on the WM_MOUSEMOVE message. You don't need to call TrackMouseEvent every time WM_MOUSEMOVE is fired, just once up until you get another WM_MOUSELEAVE. After you get a WM_MOUSELEAVE you can set some flag so the next call to WM_MOUSEMOVE will know to call TrackMouseEvent again.

Basically you can emulate a fictional WM_MOUSEENTER by using WM_MOUSEMOVE and also having that flag set.

Brian R. Bondy
Which event is that?
Milo
@ user146780: See edit
Brian R. Bondy