[win32 c++] retrieving mouse cursor position relative to window position

Started by
2 comments, last by load_bitmap_file 18 years, 10 months ago
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?
Advertisement
POINT pt;
GetCursorPos(&pt);
ScreenToClient(hWnd, &pt);
that was fast-- thanks!
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