Moves a control within a window.
ControlMove ( "title", "text", controlID, x, y [, width [, height]] )
title | The title/hWnd/class of the window to access. See Title special definition. |
text | The text of the window to access. See Text special definition. |
controlID | The control to interact with. See Controls. |
x | X coordinate to move to relative to the window client area. |
y | Y coordinate to move to relative to the window client area. |
width | [optional] New width of the window. |
height | [optional] New height of the window. |
Success: | 1. |
Failure: | 0 if window/control is not found. |
If x and y equal to the Default keyword no move occurs, just resizing.
Example()
Func Example()
; Run Notepad
Run("notepad.exe")
; Wait 10 seconds for the Notepad window to appear.
Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)
; Wait for 2 seconds.
Sleep(2000)
; Move the edit control of Notepad using the handle returned by WinWait.
ControlMove($hWnd, "", "Edit1", 0, 0, 150, 150)
; Wait for 2 seconds.
Sleep(2000)
; Close the Notepad window using the handle returned by WinWait.
WinClose($hWnd)
EndFunc ;==>Example