Capturing mouse clicks on a custom Win32 control
-
I haven't done much straight Win32 programming (mostly just use MFC), so learning how to create a custom Win32 control has been a challenge. I've created a static control, I'm drawing it using WM_DRAWITEM, and capturing mouse click events using STN_CLICKED. I'm now stuck on finding the mouse cursor's position relative to my control. I'm capturing the WM_MOUSEMOVE event and saving the mouse position, and then using ClientToScreen and ScreenToClient to convert the mouse position to a relative coordinate. That works, but for some reason WM_MOUSEMOVE isn't sent when the mouse is over my control; everywhere else, it is. I'm guessing that the mouse event is being sent somewhere else, but I can't figure out where; can you help me?
-
I haven't done much straight Win32 programming (mostly just use MFC), so learning how to create a custom Win32 control has been a challenge. I've created a static control, I'm drawing it using WM_DRAWITEM, and capturing mouse click events using STN_CLICKED. I'm now stuck on finding the mouse cursor's position relative to my control. I'm capturing the WM_MOUSEMOVE event and saving the mouse position, and then using ClientToScreen and ScreenToClient to convert the mouse position to a relative coordinate. That works, but for some reason WM_MOUSEMOVE isn't sent when the mouse is over my control; everywhere else, it is. I'm guessing that the mouse event is being sent somewhere else, but I can't figure out where; can you help me?