I can get the coordinates of a windows entire area, and the coordinates of the client area using the GetClientRect and GetWindowRect Win32 calls. My problem is that the GetClientRect always returns 0,0 for the top left. How do I figure out what the actual client region is relative to the window rect?
+2
A:
Use ClientToScreen to convert the client coordinates to screen coordinates. The window rect (GetWindowRect) is already in screen coordinates, and includes the non-client area (borders, caption, etc)
dthorpe
2010-07-13 23:17:53
+3
A:
You can use ClientToScreen to get the coordinates of the upper left (0,0) point in screen coordinates. The RECT returned by GetClientRect will be appropriate to get you the lower right corner (just add to the POINT set by ClientToScreen).
Reed Copsey
2010-07-13 23:19:08
A:
You can also use the MapWindowPoints function to convert an entire RECT to screen coordinates at once.
Ben Voigt
2010-07-14 00:04:52