Method Reference (COM)

ControlClick

Sends a mouse click command to a given control.

ControlClick "title", "text", "controlID" [, button] [, clicks]]

 

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.

 

Return Value

Success: Returns 1.
Failure: Returns 0.

 

Remarks

The control might first need to be given focus with the ControlFocus command.
When using a control name in the Control functions, you need to add a number to the end of the name to indicate which control. For example, if there two controls listed called "MDIClient", you would refer to these as "MDIClient1" and "MDIClient2".

Simulating a click on a control is only 100% accurate when the control's parent window is active - this is done automatically.

 

Related

ControlCommand, ControlFocus, MouseClick

 

Example

Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
oAutoIt.ControlClick "Untitled -", "", "MDIClient1"