Function WinGetProcessByHandle

  • Retrieves the process ID associated with a window handle.

    Parameters

    • windowHandle: bigint

      The handle of the window to access.

    Returns number

    The process ID as a number.

    import { WinGetProcessByHandle, WinGetHandle } from '@ahmic/autoit-js';

    const windowHandle = WinGetHandle('Untitled - Notepad');
    const processId = WinGetProcessByHandle(windowHandle);

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