Compartir a través de


MoveWindow (Compact 2013)

3/28/2014

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.

Syntax

BOOL MoveWindow( 
  HWND hWnd, 
  int X, 
  int Y, 
  int nWidth, 
  int nHeight, 
  BOOL bRepaint 
); 

Parameters

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

Return Value

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

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.

Requirements

Header

winuser.h

See Also

Reference

Window Functions
SetWindowPos
UpdateWindow
WM_PAINT