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通过解析搜狐网页来获取天气的函数

Delphi 遍历pe文件

Delphi windows 编程[19] - 改变菜单项的状态: getmenustate、enablemenuitem

base64.pas

Delphi2010的操作界面切换到Delphi7的操作模式

Delphi xe 安卓开发黑屏的另一种解决办法

Delphi xe2读取内存偏移数据代码

Delphi 通过有道接口实现翻译

Delphi的四舍五入函数

Delphi 相对路径和绝对路径的转换

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



打赏

取消

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

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

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

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

评论

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