The handle of the window to access.
The handle of the control to enable.
1 if success, 0 if failure.
import {
ControlDisableByHandleSync,
ControlEnableByHandleSync,
ControlGetHandleSync,
WinGetHandleSync,
} from '@ahmic/autoit-js';
const windowHandle = WinGetHandleSync('Untitled - Notepad');
const controlHandle = ControlGetHandleSync(windowHandle, 'Edit1');
// Disable the Notepad window's edit control.
ControlDisableByHandleSync(windowHandle, controlHandle);
// Enable the Notepad window's edit control.
ControlEnableByHandleSync(windowHandle, controlHandle);
Enables a control in a window.