Method Reference
ControlClick
Sends a mouse click command to a given control
ControlClick "title", "text", "controlID" [, button [, clicks [, x [, y ]]]]
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. |
button | Optional: The button to click, "left", "right" or "middle". Default is the left button. |
clicks | Optional: The number of times to click the mouse. Default is 1. |
x | Optional: The x position to click within the control. Default is center. |
y | Optional: The y position to click within the control. Default is center. |
Return Value
Success: | Returns 1. |
Failure: | Returns 0. |
Remarks
Some controls will resist clicking unless they are the active window. Use the WinActive() function to force the control's window to the top before using ControlClick().
Using 2 for the number of clicks will send a double-click message to the control - this can even be used to launch programs from an explorer control!
Related
ControlCommand, MouseClick, WinActivate
Example
Set oAutoIt = WScript.CreateObject("AutoItX3.Control") oAutoIt.ControlClick "Untitled -", "", "MDIClient1"