Expand Minimize
This topic has not yet been rated - Rate this topic

ScreenToClient

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

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


BOOL ScreenToClient( 
  HWND hWnd, 
  LPPOINT lpPoint
); 
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.

Nonzero indicates success. Zero indicates failure.

To get extended error information, call GetLastError.

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 ScreenToClient function assumes the specified point is in screen coordinates.

All coordinates are in device units.

Regardless of the screen's layout settings, ScreenToClient always interprets coordinates as if the screen layout is left-to-right. Do not use this function if your screen has a right-to-left layout. Instead, use MapWindowPoints.

Headerwinuser.h
Librarycoredll.lib, Winmgr.lib
Windows Embedded CEWindows CE 1.0 and later
Windows MobileWindows Mobile Version 5.0 and later
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.