In order for WinCalcFrameRect to perform its calculations correctly, the window rectangle in prcl must be specified in screen coordinates. The WinMapWindowPoints function is called to make the conversion from client coordinates to screen coordinates, as shown in the example code.

WinCalcFrameRect provides the size and position of the client area within the specified frame rectangle for the specified frame window, or conversely, the size and position of the frame window that would contain a client window of the specified size and position.

WinCalcFrameRect sends a WM_CALCFRAMERECT message to the frame window. This enables a subclassed frame control to implement the calculation correctly.

This function works if hwndFrame is hidden; hwndFrame should be hidden if it is required that the window shows a particular client rectangle when the window is first shown.


[Back] [Next]