Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic


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

void ClientToScreen( 
   LPPOINT lpPoint  
) const; 
void ClientToScreen( 
   LPRECT lpRect  
) const;

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


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

The ClientToScreen member function uses the client coordinates in the POINT or RECT structure or the CPoint or CRect object pointed to by lpPoint or lpRect to compute new screen coordinates; it then replaces the coordinates in the structure with the new coordinates. The new screen coordinates are relative to the upper-left corner of the system display.

The ClientToScreen member function assumes that the given point or rectangle is in client coordinates.

// resize dialog to client's size 
void CMyDlg::OnSizeToClient()
   CRect myRect;

   MoveWindow(myRect.left, myRect.top,
      myRect.Width(), myRect.Height());

Header: afxwin.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.