CWnd::ScreenToClient

Syntax

void ScreenToClient( LPPOINT lpPoint ) const;

void ScreenToClient( LPRECT lpRect ) const;

Parameters

lpPoint

Points to a CPoint or POINT structure that contains the screen coordinates to be converted.

lpRect

Points to a CRect or RECT structure that contains the screen coordinates to be converted.

Remarks

Converts the screen coordinates of a given point or rect on the display to client coordinates.

The ScreenToClient member function uses CWnd and the screen coordinates given in lpPoint or lpRect to compute client coordinates, and then replaces the screen coordinates with the client coordinates. The new coordinates are relative to the upper-left corner of the CWnd client area.

The ScreenToClient formula assumes the given point is in screen coordinates.

See Also

CWnd::ClientToScreen ::ScreenToClient