getting Exact Screen Coordinates

Started by
2 comments, last by Pse 19 years, 4 months ago
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,
~guyaton
Advertisement
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
Hack my projects! Oh Yeah! Use an SVN client to check them out.BlockStacker
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.
<span class="smallfont">That is not dead which can eternal lieAnd with strange aeons even death may die.   -- "The Nameless City" - H. P. Lovecraft</span>
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