A version of this page is also available for
This function changes the position and dimensions of the specified window. For a top-level window, the position and dimensions are relative to the upper-left corner of the screen. For a child window, they are relative to the upper-left corner of the parent window's client area.
BOOL MoveWindow( HWND hWnd, int X, int Y, int nWidth, int nHeight, BOOL bRepaint );
[in] Handle to the window.
[in] Specifies the new position of the left side of the window.
[in] Specifies the new position of the top of the window.
[in] Specifies the new width of the window.
[in] Specifies the new height of the window.
[in] Boolean that specifies whether the window is to be repainted. However, this parameter is ignored and is assumed to be FALSE. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of moving a child window. The application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing.
Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
The bRepaint parameter is ignored and is assumed to be FALSE. This means that the system places the WM_PAINT message in the message queue associated with the window. The message loop dispatches the WM_PAINT message only after dispatching all other messages in the queue.
|Windows Embedded CE||Windows CE 1.0 and later|
|Windows Mobile||Windows Mobile Version 5.0 and later|