WinPosition

Returns Window position.

Syntax:

WinPosition (partial-winname)

Parameters:

(s) partial-winname the initial part of, or an entire, winname.

Returns:

(s)  window coordinates, delimited by commas.

 

Returns the current window position information for the selected window. It returns 4 comma-separated numbers (see WinPlace for details)

This function works only with top-level (parent) application windows.

All coordinates are relative to a virtual 1000x1000 screen.

Note: 1000x1000 virtual screen size is based on the primary monitor in a multi-monitor display configuration

Example:

Run("notepad.exe", "") ; start Notepad
WinPlace(0,0,300,300, "~Notepad") ; place Notepad
pos = WinPosition("~Notepad") ; save position
TimeDelay(2)
WinPlace(200,200,300,300, "~Notepad") ; move Notepad
Delay(2)
WinPlace(%pos%, "~Notepad") ; restore Notepad

See Also:

WinGetActive, WinItemize, WinPositionChild, WinPlace, WinPlaceGet, WinState, Partial Window Names, IntControl 46