getting Exact Screen Coordinates
I'm trying to get the coordinates of the mouse inside my window: currently I have this:
POINT pt;
GetCursorPos(&pt);
ScreenToClient( m_hwnd, &pt);
but the only problem is that this seems to include the boarder of the window. Is there a function that can remove the boarder and give me the coordinates only while it is inside the window "box" if thats what its called?
thanks,
Do some research on the AdjustWindowRect() API function. I think I remenber myself using that for a similar purpose sometime, but I don't remember exactly how it works...
Best of luck
Best of luck
There's MapWindowPoints( ), but that's probably overkill. You might consider just writing your own mapping function. You could use GetWindowRect( ) to get the windows origin, then subtract from the screen coordinates.
I'd try using GetClientRect, just to get the RECT to the client area of the window only... But, you'll have to try it...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement