SetWindowPos - Win32 API reference
From HashVB
The SetWindowPos function changes the size, position, and Z order of a child, pop-up, or top-level window. Child, pop-up, and top-level windows are ordered according to their appearance on the screen. The topmost window receives the highest rank and is the first window in the Z order.
Declaration
Declare Sub SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
Parameters
- hWnd
- Handle to the window.
- hWndInsertAfter
- Handle to the window to precede the positioned window in the Z order.
- HWND_BOTTOM
- HWND_NOTOPMOST
- HWND_TOP
- HWND_TOPMOST
- X
- Specifies the new position of the left side of the window, in client coordinates.
- Y
- Specifies the new position of the top of the window, in client coordinates.
- cx
- Specifies the new width of the window, in pixels.
- cy
- Specifies the new height of the window, in pixels.
- wFlags
- Specifies the window sizing and positioning flags.
- SWP_ASYNCWINDOWPOS
- SWP_DEFERERASE
- SWP_DRAWFRAME
- SWP_FRAMECHANGED
- SWP_HIDEWINDOW
- SWP_NOACTIVATE
- SWP_NOCOPYBITS
- SWP_NOMOVE
- SWP_NOOWNERZORDER
- SWP_NOREDRAW
- SWP_NOREPOSITION
- SWP_NOSENDCHANGING
- SWP_NOSIZE
- SWP_NOZORDER
- SWP_SHOWWINDOW
Return value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, callGetLastError.

