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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to call
TrackMouseEventwhen the mouse enters your control, and not when it leaves your control.You can call
TrackMouseEventon theWM_MOUSEMOVEmessage. You don’t need to callTrackMouseEventevery timeWM_MOUSEMOVEis fired, just once up until you get anotherWM_MOUSELEAVE. After you get aWM_MOUSELEAVEyou can set some flag so the next call toWM_MOUSEMOVEwill know to callTrackMouseEventagain.Basically you can emulate a fictional
WM_MOUSEENTERby usingWM_MOUSEMOVEand also having that flag set.