ProcessHandle2PID()

Example Code

function ProcessHandle2PID(const hProcess: THandle): DWORD; stdcall; // Retrieves the process identifier (ID) of the target process handle var dwProcessId: DWORD; begin dwProcessId := ProcessHandle2PID(GetCurrentProcess()); ShowMessage(Format('My current Process Id is %u', [dwProcessId])); end;