Translating Client Coordinates to Screen CoordinatesLast reviewed: November 2, 1995Article ID: Q11570 |
The information in this article applies to:
SUMMARYThe GetClientRect function always returns the coordinates (0, 0) for the origin of a window. This behavior is documented in the "Microsoft Windows Software Development Kit (SDK) Programmer's Reference" manual.
MORE INFORMATIONTo determine the screen coordinates for the client area of a window, call the ClientToScreen function to translate the client coordinates returned by GetClientRect into screen coordinates. The following code demonstrates how to use the two functions together:
RECT rMyRect; GetClientRect(hwnd, (LPRECT)&rMyRect); ClientToScreen(hwnd, (LPPOINT)&rMyRect.left); ClientToScreen(hwnd, (LPPOINT)&rMyRect.right); |
Additional reference words: 3.00 3.10 3.50 3.51 4.00 95
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |