Retrieves the process ID associated with a window handle.
The handle of the window to access.
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 Copy
import { WinGetProcessByHandle, WinGetHandle } from '@ahmic/autoit-js';const windowHandle = WinGetHandle('Untitled - Notepad');const processId = WinGetProcessByHandle(windowHandle);console.log(processId); // Output: 1234
https://www.autoitscript.com/autoit3/docs/functions/WinGetProcess.htm
Retrieves the process ID associated with a window handle.