@ahmic/autoit-js
    Preparing search index...

    Function ControlEnableByHandleSync

    • Enables a control in a window.

      Parameters

      • windowHandle: bigint

        The handle of the window to access.

      • controlHandle: bigint

        The handle of the control to enable.

      Returns number

      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);