void ClientToScreen(hwnd, lppt) | |||||
HWND hwnd; | /* window handle for source coordinates | */ | |||
POINT FAR* lppt; | /* address of structure with coordinates | */ |
The ClientToScreen function converts the client coordinates of a given point on the screen to screen coordinates.
hwnd
Identifies the window whose client area is used for the conversion.
lppt
Points to a POINT structure that contains the client coordinates to be converted. The POINT structure has the following form:
typedef struct tagPOINT { /* pt */
int x;
int y;
} POINT;
For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.
This function does not return a value.
The ClientToScreen function replaces the coordinates in the POINT structure with the screen coordinates. The screen coordinates are relative to the upper-left corner of the screen.
The following example uses the LOWORD and HIWORD macros and the ClientToScreen function to convert the mouse position to screen coordinates:
POINT
pt; pt.x = LOWORD(lParam); pt.y = HIWORD(lParam); ClientToScreen(hwnd, &pt);