The handle of the window to access.
The handle of the control to enable.
A promise that resolves to 1 if success, or 0 if failure.
import {
ControlDisableByHandle,
ControlEnableByHandle,
ControlGetHandle,
WinGetHandle,
} from '@ahmic/autoit-js';
const windowHandle = await WinGetHandle('Untitled - Notepad');
const controlHandle = await ControlGetHandle(windowHandle, 'Edit1');
// Disable the Notepad window's edit control.
await ControlDisableByHandle(windowHandle, controlHandle);
// Enable the Notepad window's edit control.
await ControlEnableByHandle(windowHandle, controlHandle);
Enables a control in a window.