Home > Language Reference > Windows Management Functions > MoveWindow

MoveWindow

The MoveWindow function moves the specified window to the specified position.

Usage

Used to move a window to a certain position on the screen.

Syntax

ret=MoveWindow(<window_name>,<x>,<y>)

Parameters

<window_name>, string, window name including its instance number of the window to move. You can truncate <window_name> to restore a window whose title starts with the specified characters.

<x>,<y>, integer, coordinates location on the screen of the topleft point of <window_name>. The coordinates cannot be negative.

Return value

ret, optional numeric return value. If the window has been successfully moved within 30 seconds (this default value can be changed using #ActionTimeout), the function returns 0. If the function fails, the return value is a nonzero value (see Window Functions Error Codes).

See also

SizeWindow

Example

Shell("notepad")
MoveWindow("NOTEPAD.EXE|Notepad|Untitled - Notepad",1, 150, 200)