Function ControlGetFocus

  • Gets the ID of the control that has keyboard focus in a window.

    Parameters

    • windowTitle: string

      The title of the window to access.

    • windowText: string = ''

      Optional text found in the window.

    Returns string

    The ID of the control that has keyboard focus.

    import { ControlGetFocus } from '@ahmic/autoit-js';

    const className = ControlGetFocus('Untitled - Notepad');

    console.log(className); // Output: "Edit1"