Share via


CWnd::MoveWindow

voidMoveWindow(intx**,inty,intnWidth,intnHeight,BOOLbRepaint=TRUE);**

voidMoveWindow(LPCRECTlpRect, BOOLbRepaint = TRUE);

Parameters

x

Specifies the new position of the left side of the CWnd.

y

Specifies the new position of the top of the CWnd.

nWidth

Specifies the new width of the CWnd.

nHeight

Specifies the new height of the CWnd.

bRepaint

Specifies whether CWnd is to be repainted. If TRUE, CWnd receives a message in its OnPaint message handler as usual. If this parameter is FALSE, no repainting of any kind occurs. This applies to the client area, to the nonclient area (including the title and scroll bars), and to any part of the parent window uncovered as a result of Cwnd’s move. When this parameter is FALSE, the application must explicitly invalidate or redraw any parts of CWnd and parent window that must be redrawn.

lpRect

The CRect object or RECT structure that specifies the new size and position.

Remarks

Changes the position and dimensions.

For a top-level CWnd object, the x and y parameters are relative to the upper-left corner of the screen. For a child CWnd object, they are relative to the upper-left corner of the parent window’s client area.

The MoveWindow function sends the WM_GETMINMAXINFO message. Handling this message gives CWnd the opportunity to modify the default values for the largest and smallest possible windows. If the parameters to the MoveWindow member function exceed these values, the values can be replaced by the minimum or maximum values in the WM_GETMINMAXINFO handler.

Example

See the example for CWnd::ClientToScreen.

CWnd OverviewClass MembersHierarchy Chart

See Also   CWnd::SetWindowPos, WM_GETMINMAXINFO,