Export (0) Print
Expand All

MoveWindow

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

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 
); 

hWnd

[in] Handle to the window.

X

[in] Specifies the new position of the left side of the window.

Y

[in] Specifies the new position of the top of the window.

nWidth

[in] Specifies the new width of the window.

nHeight

[in] Specifies the new height of the window.

bRepaint

[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.

Headerwinuser.h
Windows Embedded CEWindows CE 1.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions

ADD
Show:
© 2014 Microsoft