MoveWindow

  BOOL MoveWindow(hwnd, X, Y, nWidth, nHeight, bRepaint)    
  HWND hwnd; /* handle of window */
  int X; /* left coordinate */
  int Y; /* top coordinate */
  int nWidth; /* width */
  int nHeight; /* height */
  BOOL bRepaint; /* repaint flag */

This function sizes and repositions the window specified by hwnd. This function causes a WM_SIZE and/or a WM_MOVE message to be sent to the given window. The X, Y, nWidth, and nHeight parameters give the new position and size of the window.

Parameters

hwnd

Identifies a pop-up or child window.

X

Specifies the new x-coordinate of the upper-left corner of the window.

Y

Specifies the new y-coordinate of the upper-left corner of the window. For pop-up windows, X and Y are in screen coordinates (relative to the upper-left corner of the screen). For child windows, they are in client coordinates (relative to the upper-left corner of the parent window's client area).

nWidth

Specifies the new width of the window.

nHeight

Specifies the new height of the window.

bRepaint

Specifies whether or not the window is repainted after moving. If bRepaint is zero, the window is not repainted.

Return Value

TRUE is returned for success, FALSE for failure.

Comments

The WM_SIZE message created by this function gives the new width and height of the client area of the window, not of the full window.

See Also

SetWindowPos