The handle of the window to access.
The handle of the control to retrieve text from.
The maximum number of characters to retrieve. Default is 1024.
The text of the control.
import { ControlGetTextByHandle, ControlGetHandle, WinGetHandle } from '@ahmic/autoit-js';
const windowHandle = WinGetHandle('Untitled - Notepad');
const controlHandle = ControlGetHandle(windowHandle, 'Edit1');
const text = ControlGetTextByHandle(windowHandle, controlHandle);
console.log(text); // Output: "Sample text"
Retrieves the text from a control in a window.