I would like to capture the mouse move event in my main form. Although I am able to wire up the MouseEventHandler for the main form, the event no longer fires when the cursor is over a UserControl or any other control. How do I ensure that I always have the mouse position.
I would like to capture the mouse move event in my main form. Although
Share
You could use a low level mouse hook. See this example and check for the WM_MOUSEMOVE mesage in HookCallback.
You could also use the IMessageFilter class to catch the Mouse Events and trigger an event to get the position (note: this will only get the position over the window, not outside of it):