Mouse Postion
-
I have problem of getting the mouse position!!!! I want to know how to get the mouse position when user move their mouse to anywhere, but not just inside my program!!!! Anyone can help me???
Hi Sunny, You may try with SetCapture(HWND) which directs mouse input to the specified window, but there are many actions the user may take that cause your application to loose the mouse capture (i.e. click on a menu). You could handle WM_CAPTURECHANGED messages, but even that wouldn't help much (refer to MSDN for details). Also, you should call ReleaseCapture() when you've finished using mouse input. If you need mouse input to do short operations, this could be fine, otherwise you may install a hook with SetWindowsHookEx() (refer to MSDN to know how to use hooks). Hope this helps, Paolo.