MoveWindow

Syntax

void MoveWindow(hWnd,X,Y,nWidth,nHeight,bRepaint)

This function causes a WM_SIZE message to be sent to the given window. The X, Y, nWidth, and nHeight parameters give the new size of the window.

Parameter Type/Description  

hWnd HWND Identifies a pop-up or child window.  
X int Specifies the new x-coordinate of the upper-left corner of the window.  
Y int 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 int Specifies the new width of the window.  
nHeight int Specifies the new height of the window.  
bRepaint BOOL Specifies whether or not the window is repainted after moving. If bRepaint is zero, the window is not repainted.  

Return Value

None.

Comments

Any child or pop-up window has a minimum width and height. These minimums depend on the style and content of the window. Any attempt to make the width and height smaller than the minimum by using the MoveWindow function will fail. 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.