Export (0) Print
Expand All

ClientToScreen function

The ClientToScreen function converts the client-area coordinates of a specified point to screen coordinates.

Syntax


BOOL ClientToScreen(
  _In_     HWND hWnd,
  _Inout_  LPPOINT lpPoint
);

Parameters

hWnd [in]

A handle to the window whose client area is used for the conversion.

lpPoint [in, out]

A pointer to a POINT structure that contains the client coordinates to be converted. The new screen coordinates are copied into this structure if the function succeeds.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

The ClientToScreen function replaces the client-area coordinates in the POINT structure with the screen coordinates. The screen coordinates are relative to the upper-left corner of the screen. Note, a screen-coordinate point that is above the window's client area has a negative y-coordinate. Similarly, a screen coordinate to the left of a client area has a negative x-coordinate.

All coordinates are device coordinates.

Examples

For an example, see "Drawing Lines with the Mouse" in Using Mouse Input.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Coordinate Spaces and Transformations Overview
Coordinate Space and Transformation Functions
MapWindowPoints
POINT
ScreenToClient

 

 

Community Additions

ADD
Show:
© 2014 Microsoft