BOOL ScreenToClient(hwnd, lpPoint) | |||||
HWND hwnd; | /* window handle for source coordinates | */ | |||
LPPOINT lpPoint; | /* address of structure with coordinates | */ |
The ScreenToClient function converts the screen coordinates of a given point on the display to client coordinates.
hwnd
Identifies the window whose client area will be used for the conversion.
lpPoint
Points to a POINT data structure that contains the screen coordinates to be converted. The POINT structure has the following form:
typedef struct tagPOINT { /* pt */
LONG x;
LONG y;
} POINT;
Returns TRUE for success, FALSE for failure.
The function uses the window identified by the hwnd parameter and the screen coordinates given in the structure pointed to by the lpPoint parameter to compute client coordinates. It then replaces the screen coordinates with the client coordinates. The new coordinates are relative to the upper-left corner of the given window's client area.
The ScreenToClient formula assumes the given point is in screen coordinates.
ClientToScreen