Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.


Windows Mobile 6.5
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.

MoveWindow sends WM_WINDOWPOSCHANGED, WM_MOVE, and WM_SIZE messages to the window.

Windows Embedded CEWindows CE 1.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions

© 2015 Microsoft