Function WinGetProcess

  • Retrieves the process ID associated with a window.

    Parameters

    • windowTitle: string

      The title of the window to access.

    • windowText: string = ''

      Optional text found in the window.

    Returns number

    The process ID as a number.

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

    const processId = WinGetProcess('Untitled - Notepad');

    console.log(processId); // Output: 1234