ScreenToClient

This function converts the screen coordinates of a specified point on the screen to client coordinates.

BOOL ScreenToClient( 
  HWND hWnd, 
  LPPOINT lpPoint
); 

Parameters

  • hWnd
    Handle to the window whose client area will be used for the conversion.
  • lpPoint
    Long pointer to a POINT structure that contains the screen coordinates to be converted.

Return Values

Nonzero indicates success. Zero indicates failure.

To get extended error information, call GetLastError.

Remarks

The function uses the window identified by the hWnd parameter and the screen coordinates given in the POINT structure 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 specified window's client area.

The ScreenToClient function assumes the specified point is in screen coordinates.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Winuser.h.
Link Library: Coredll.lib, Winmgr.lib.

See Also

ClientToScreen | MapWindowPoints | POINT

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.