delphi 检测进程是否存在函数


本文整理自网络,侵删。

 uses
TlHelp32;


function CheckTask(ExeFileName: string): Boolean; //检测XX进程是否存在函数
const
PROCESS_TERMINATE = $0001;
var
ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
begin
result := False;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
while integer(ContinueLoop) <> 0 do begin
if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) = UpperCase(ExeFileName))
or (UpperCase(FProcessEntry32.szExeFile) = UpperCase(ExeFileName))) then
result := True;
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
end;

相关阅读 >>

Delphi 调用win32 api操作串口

Delphi jpg/jpeg 图片缩放函数

Delphi中datetimepicker组件介绍

Delphi 强制删除文件 zwdeletefile

Delphi根据网络链接截取域名

精通Delphi模拟按键

Delphi 得到执行程序的当前所在完整路径

Delphi使用idhttp模拟提交页面方法总结

Delphi 获取硬盘序列号(ide,sata,scsi)

Delphi apihook createprocess

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



打赏

取消

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

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

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

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

评论

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