UNPKG

@ahmic/autoit-js

Version:
49 lines (48 loc) 1.9 kB
/** * Retrieves the text from a control in a window. * * @param windowHandle The handle of the window to access. * @param controlHandle The handle of the control to retrieve text from. * @param characterCount The maximum number of characters to retrieve. Default is 1024. * * @returns The text of the control. * * @example * ```typescript * import { ControlGetTextByHandleSync, ControlGetHandleSync, WinGetHandleSync } from '@ahmic/autoit-js'; * * const windowHandle = WinGetHandleSync('Untitled - Notepad'); * const controlHandle = ControlGetHandleSync(windowHandle, 'Edit1'); * * const text = ControlGetTextByHandleSync(windowHandle, controlHandle); * * console.log(text); // Output: "Sample text" * ``` * * @see https://www.autoitscript.com/autoit3/docs/functions/ControlGetText.htm */ export declare function ControlGetTextByHandleSync(windowHandle: bigint, controlHandle: bigint, characterCount?: number): string; /** * Retrieves the text from a control in a window. * * @param windowHandle The handle of the window to access. * @param controlHandle The handle of the control to retrieve text from. * @param characterCount The maximum number of characters to retrieve. Default is 1024. * * @returns A promise that resolves to the text of the control. * * @example * ```typescript * import { ControlGetTextByHandle, ControlGetHandle, WinGetHandle } from '@ahmic/autoit-js'; * * const windowHandle = WinGetHandle('Untitled - Notepad'); * const controlHandle = ControlGetHandle(windowHandle, 'Edit1'); * * const text = await ControlGetTextByHandle(windowHandle, controlHandle); * * console.log(text); // Output: "Sample text" * ``` * * @see https://www.autoitscript.com/autoit3/docs/functions/ControlGetText.htm */ export declare function ControlGetTextByHandle(windowHandle: bigint, controlHandle: bigint, characterCount?: number): Promise<string>;