delphi 通过进程ID获取进程名


本文整理自网络,侵删。

 
uses TLhelp32
function GetProcessNameById(const AID: Integer): String;
var    
h:thandle;     
f:boolean;     
lppe:tprocessentry32;
begin    
Result := '';     
h := CreateToolhelp32Snapshot(TH32cs_SnapProcess, 0);     
lppe.dwSize := sizeof(lppe);     
f := Process32First(h, lppe);     
while integer(f) <> 0 do    
begin      
if Integer(lppe.th32ProcessID) = AID then      
begin        
Result:= StrPas(lppe.szExeFile);         
break;       
end;       
f := Process32Next(h, lppe);     
end;
end;

相关阅读 >>

Delphi tsearchrec

Delphi 如何让 tgpimage 直接从流中加载图片?

Delphi 字符串左右添加字符

Delphi datetime,date,time tdatetimepicker

Delphi webbrowser选中文本操作 设置webbrowser的内容

Delphi 中的字符串

Delphi判断某一个点是否在一个区域内

Delphi清除右下角的托盘上无用的托盘图标(刷新托盘)

Delphi android 平台加载文件

Delphi中对url进行编码和解码

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...