This is how I managed to get current process id:
import winim
proc vGetCurrentProcID*(): int32 =
var
hwnd: HWND = GetForegroundWindow()
pid: int32
GetWindowThreadProcessId(hwnd, pid.addr)
return pid
Run
- How do I get the process ID of the current program? Schelz
