Process Id

Get Process Name Method 1

March 12, 2020
Delphi, Full Path, Image Path, Process Name, Process Id

This one possible technique (through QueryFullProcessImageNameW) to get process image path from it id. This example support Windows Vista to latest Windows version (Actually Windows 10) I will cover other example progressively and compatible with Windows XP and below. // Jean-Pierre LESUEUR (@DarkCoderSc) //... uses Windows, SysUtils; //... function GetProcessName(AProcessID : Cardinal) : String; var hProc : THandle; ALength : DWORD; hDLL : THandle; QueryFullProcessImageNameW : function( AProcess: THANDLE; AFlags: DWORD; AFileName: PWideChar; var ASize: DWORD): BOOL; stdcall; const PROCESS_QUERY_LIMITED_INFORMATION = $00001000; begin result := ''; /// if (TOSVersion. ...