WinMove (statement)


WinMove x,y [window_name$ | window_object]


Moves the given window to the given x,y position.


The WinMove statement requires the following parameters:






Integer coordinates given in twips that specify the new location for the window.



String containing the name that appears on the desired application's title bar.  Optionally, a partial name can be used, such as "Word" for "Microsoft Word."

A hierarchy of windows can be specified by separating each window name with a vertical bar (|), as in the following example:

  WinActivate "Notepad|Find"

In this example, the top-level windows are searched for a window whose title contains the word "Notepad".  If found, the windows owned by the top level window are searched for one whose title contains the string "Find".



HWND object specifying the exact window to activate. This can be used in place of the window_name$ parameter to indicate a specific window to activate.


If window_name$ and window_object are omitted, then the window with the focus is moved.

This command differs from the AppMove command in that this command operates on the current window rather than the current top-level window. When moving child windows, remember that the x and y coordinates are relative to the client area of the parent window.


This example moves Program Manager to upper left corner of the screen.

WinMove 0,0,"Program Manager"

See Also

WinSize (statement).


Under Windows, the current window can be an MDI child window, a pop-up window, or a top-level window.

More information