Method WinGetPosX

AutoIt X

Method Reference


WinGetPosX

Retrieves the position and size of a given window

WinGetPosX "title" [, "text"]

Parameters

title The title of the window to read.
text Optional: The text of the window to read.

Return Value

Success: Returns the X coordinate of the window.
Failure: Returns numeric 1 and sets oAutoIt.error to 1 if windows is not found.

Remarks

WinGetPosX returns negative numbers such as -32000 for minimized windows, but works fine with (non-minimized) hidden windows.
If the window title "Program Manager" is used, the function will return the size of the desktop. If multiple windows match the criteria, the most recently active window is used.

Related

WinGetClientSizeHeight, WinGetClientSizeWidth, WinMove

Example


Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
x = oAutoIt.WinGetPosX("")
y = oAutoIt.WinGetPosY("")
width = oAutoIt.WinGetPosWidth("")
height = oAutoIt.WinGetPosHeight("")