Basically, I call TrackMouseEvent in my WM_CREATE then I also called it again after a WM_MOUSELEAVE event, but this freezes up my program.
Where should I be sticking it?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With