Retrieves the position and size of a control relative to its window.
ControlGetPos ( "title", "text", controlID )
| title | The title of the window to access. |
| text | The text of the window to access. |
| controlID | The control to interact with. See Controls. |
| 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. |
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])