[win32 c++] retrieving mouse cursor position relative to window position
How can I obtain the mouse cursor's position relative to a window's position in Visual C++?
I can't use GetCursor() because it retrieves the position relative to the screen. Maybe I could use this function if I perhaps knew how to retrieve my window's position relative to the screen...
Anyone?
Quote:Original post by Desdemona
POINT pt;
GetCursorPos(&pt);
ScreenToClient(hWnd, &pt);
Bwahaha! You have inadvertently helped me as well! This ScreenToClient() is a nice function. [smile]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement