Core Function ControlClick

From Sputnik Wiki
Jump to: navigation, search
ControlClick ( <title>, <text>, <controlID>, <button>, <clicks>, <x>, <y> )

Contents

Description

Sends a mouse click command to a given control.

Parameters

Title

The title of the window to access.

Text

The text of the window to access.

controlID

The control to interact with.

button

Optional; The button to click, "left", "right", "middle", "main", "menu", "primary", "secondary".

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.

Note if value is -1 it will become center.

y

Optional; The y position to click within the control.

Default is center.

Note if value is -1 it will become center.

Return Value

Success: Returns true.

Failure: Returns false if window/control is not found.

Remarks

Some controls will resist clicking unless they are the active window. Use the WinActivate() 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.

If the user has swapped the left and right mouse buttons in the control panel, then the behavior of the buttons is different. "Left" and "right" always click those buttons, whether the buttons are swapped or not.

The "primary" or "main" button will be the main click, whether or not the buttons are swapped. The "secondary" or "menu" buttons will usually bring up the context menu, whether the buttons are swapped or not.

Example

ControlClick("WinAMP Controller", "", "Button1");
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox