我使用JCL函数JclSysInfo.RunningProcessesList
来获取正在运行的进程列表。但是,许多返回的进程只包含exe文件名,而其他进程包含整个文件路径,例如:
dopus.exe
C:\ Program Files \ Listary \ Listary.exe
C:\ Program Files(x86)\ Direct Folders \ df.exe
Everything.exe
等...
代码:
uses
..., JclSysInfo;
procedure GetRunningProcesses;
var
RunningProcesses: TStringList;
begin
RunningProcesses := TStringList.Create;
try
if JclSysInfo.RunningProcessesList(RunningProcesses, True) then
CodeSite.Send('RunningProcesses', RunningProcesses);
finally
RunningProcesses.Free;
end;
end;
那么如何获得所有进程都具有完整文件路径的正在运行的进程列表?