delphi 通过PID获取进程名


本文整理自网络,侵删。

 在网上找了半天,也没找到DELPHI版的PID->NAME的代码。。。找到了一份C++的,翻译成了DELPHI的,发BLOG上,方便以后查找使用。。。。

function ProcessIdToName(PID:DWORD):string;
var
hSnapshot:THandle;
PE:PROCESSENTRY32;
begin
Result:='';
hSnapshot:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
pe.dwSize:= sizeof(PROCESSENTRY32);
if Process32First(hSnapshot, pe) <> False then
begin
while (Process32Next(hSnapshot, pe)) do
begin
if (pe.th32ProcessID = PID) then
begin
Result:=pe.szExeFile;
Break;
end;
end;
end;
end;

相关阅读 >>

Delphi 几个实用的html解析函数

Delphi研究之驱动开发篇(六)--利用section与用户模式程

Delphi 列出dbgrideh被选中的值

Delphi tsearchrec

Delphi wmi 取显卡gpu信息

Delphi 用 getenvironmentvariable 获取常用系统环境变量

Delphi 利用hook技术实现键盘监控

java2op.exe,Delphi安卓原生桥接文件生成器

Delphi控件升级

Delphi readprocessmemory 输入进程id 输入读取地址

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



打赏

取消

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

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

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

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

评论

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