Function ControlSendByHandle

  • Sends a string of text to a control in a window.

    Parameters

    • windowHandle: bigint

      The handle of the window to access.

    • controlHandle: bigint

      The handle of the control to interact with.

    • value: string

      The string of text to send.

    • mode: SendMode = SendMode.Default

      The send mode to use. See SendMode for details. Default is SendMode.Default.

    Returns number

    1 if successful, 0 otherwise.

    import { ControlGetHandle, ControlSendByHandle, SendMode, WinGetHandle } from '@ahmic/autoit-js';

    const windowHandle = WinGetHandle('Untitled - Notepad');
    const controlHandle = ControlGetHandle(windowHandle, 'Edit1');

    ControlSendByHandle(windowHandle, controlHandle, 'Hello, World!', SendMode.Default);