ClientToScreen

2.x

  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.

Parameters

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.

Return Value

This function does not return a value.

Comments

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.

Example

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);

See Also

MapWindowPoints, ScreenToClient