Function Reference


ControlGetPos

Retrieves the position and size of a control relative to its window.

ControlGetPos ( "title", "text", controlID )

Parameters

title The title of the window to access.
text The text of the window to access.
controlID The control to interact with. See Controls.

Return Value

Success: Returns an array containing the size and the control's position relative to its client window:
$array[0] = X position
$array[1] = Y position
$array[2] = Width
$array[3] = Height
Failure: Sets @error to 1.

Remarks

The title/text is referencing the parent window, so be careful with "","" which references the active window which may not be the one containing the controlID control.

Related

ControlCommand, ControlMove

Example


Run("notepad.exe")
WinWait("[CLASS:Notepad]")
Local $aPos = ControlGetPos("[CLASS:Notepad]", "", "Edit1")
MsgBox(0, "Window Stats:", "Position: " & $aPos[0] & "," & $aPos[1] & @CRLF & "Size: " & $aPos[2] & "," & $aPos[3])