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

Reply via email to