import { MouseButton } from './mouse-click'; /** * Simulates a mouse click on a control. Unlike {@linkcode MouseClickSync}, `ControlClickByHandle` won't move * the mouse cursor but is capable of clicking on controls that may be obscured by other windows. * * Where possible, you should prefer using this function over {@linkcode ControlClickSync} to avoid potential * issues with ambiguous window and control titles. * * @param windowHandle The handle of the window to access. * @param controlHandle The handle of the control to interact with. * @param button The mouse button to click. Default is {@linkcode MouseButton.Left}. * @param clicks The number of times to click the mouse. Default is 1. * @param x The x position to click within the control. Default is the center. * @param y The y position to click within the control. Default is the center. * * @returns 1 if success, 0 if failed. * * @example * ```typescript * import { * ControlClickByHandleSync, * ControlGetHandleSync, * MouseButton, * WinGetHandleSync, * } from '@ahmic/autoit-js'; * * const windowHandle = WinGetHandleSync('Untitled - Notepad'); * const controlHandle = ControlGetHandleSync(windowHandle, 'Edit1'); * * // Click the Notepad window's edit control. * ControlClickByHandleSync(windowHandle, controlHandle); * * // Right click the Notepad window's edit control. * ControlClickByHandleSync(windowHandle, controlHandle, MouseButton.Right); * * // Double click the Notepad window's edit control. * ControlClickByHandleSync(windowHandle, controlHandle, MouseButton.Left, 2); * ``` * * @see https://www.autoitscript.com/autoit3/docs/functions/ControlClick.htm */ export declare function ControlClickByHandleSync(windowHandle: bigint, controlHandle: bigint, button?: MouseButton, clicks?: number, x?: number, y?: number): number; /** * Simulates a mouse click on a control. Unlike {@linkcode MouseClick}, `ControlClickByHandle` won't move the * mouse cursor but is capable of clicking on controls that may be obscured by other windows. * * Where possible, you should prefer using this function over {@linkcode ControlClick} to avoid potential * issues with ambiguous window and control titles. * * @param windowHandle The handle of the window to access. * @param controlHandle The handle of the control to interact with. * @param button The mouse button to click. Default is {@linkcode MouseButton.Left}. * @param clicks The number of times to click the mouse. Default is 1. * @param x The x position to click within the control. Default is the center. * @param y The y position to click within the control. Default is the center. * * @returns A promise that resolves to 1 if success, or 0 if failed. * * @example * ```typescript * import { ControlClickByHandle, ControlGetHandle, MouseButton, WinGetHandle } from '@ahmic/autoit-js'; * * const windowHandle = WinGetHandle('Untitled - Notepad'); * const controlHandle = ControlGetHandle(windowHandle, 'Edit1'); * * // Click the Notepad window's edit control. * ControlClickByHandle(windowHandle, controlHandle); * * // Right click the Notepad window's edit control. * ControlClickByHandle(windowHandle, controlHandle, MouseButton.Right); * * // Double click the Notepad window's edit control. * ControlClickByHandle(windowHandle, controlHandle, MouseButton.Left, 2); * ``` * * @see https://www.autoitscript.com/autoit3/docs/functions/ControlClick.htm */ export declare function ControlClickByHandle(windowHandle: bigint, controlHandle: bigint, button?: MouseButton, clicks?: number, x?: number, y?: number): Promise;