Declare Function MoveWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Platforms: Win 32s, Win 95/98, Win NT
MoveWindow moves a window to a new location. In addition to moving it, this function also changes the window's size to a new width and height. The function returns 1 if successful, or 0 if an error occured.
Example:
' Move window Form1. Set its upper-left corner to the point (200, 150).
' Change its size to a width of 175 and a height of 300.
Dim retval As Long ' return value
' Move the window and make sure it's redrawn at its new position.
retval = MoveWindow(Form1.hWnd, 200, 150, 175, 300, 1)
' (If the last value had been 0, the window would have appeared to be unmoved!)
See Also: GetWindowRect, SetWindowPos
Category: Windows
Go back to the alphabetical Function listing.
Go back to the Reference section index.
This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/m/movewindow.html