The handle of the window to access.
The handle of the control to interact with.
The string of text to send.
The send mode to use. See SendMode
for details. Default is SendMode.Default
.
A promise that resolves to 1 if successful, or 0 otherwise.
import { ControlGetHandle, ControlSendByHandle, SendMode, WinGetHandle } from '@ahmic/autoit-js';
const windowHandle = await WinGetHandle('Untitled - Notepad');
const controlHandle = await ControlGetHandle(windowHandle, 'Edit1');
await ControlSendByHandle(windowHandle, controlHandle, 'Hello, World!', SendMode.Default);
Sends a string of text to a control in a window.