已经知道dos程序的文件名,怎么终止这个进程 已经知道dos程序的文件名,怎么终止这个进程 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 根据程序名称找到 pid ntsd -c q -p pid 列举所有进程,判断进程的szExeFile是否等于已知的dos程序名,终止这个进程. uses TlHelp32;...procedure TForm1.Button1Click(Sender: TObject);var ContinueLoop: BOOLean; FSnapshotHandle: THandle; FProcessEntry32: TProcessEntry32; ProList:TStringList; i:integer;begin inherited; FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); FProcessEntry32.dwSize := SizeOf(FProcessEntry32); ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32); ProList := TStringList.Create ; try while Integer(ContinueLoop) <> 0 do begin //加入stirnglist ProList.Add(FProcessEntry32.szExeFile); ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32); end; CloseHandle(FSnapshotHandle); ShowMessage(ProList.Text ); finally ProList.Free; end;end; 求救:连接SQL Server时的错误捕捉! 关于treeview中删除子节点的问题 请高手出招,Ocx(ActiveForm)问题,压缩和做数字签名是一对矛盾吗?Up有分。 应该学vc还是delphi Delphi中时间类型在内部怎么表示,该表示方法有什么含义???? 如何将所用的BPL连接到程序中去 寻求好的计剩余时间方法 〓〓〓〓 如何获取ip地址 〓〓〓〓 如何设置MSSQL的请求超时? 想深入掌握DELPHI,买什么书好啊? 计算机中了几个奇怪的病毒大家帮帮我 请做过门禁系统的指教!先用哪种卡比较好?
ntsd -c q -p pid
...procedure TForm1.Button1Click(Sender: TObject);
var
ContinueLoop: BOOLean;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
ProList:TStringList;
i:integer;
begin
inherited;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
ProList := TStringList.Create ;
try
while Integer(ContinueLoop) <> 0 do
begin
//加入stirnglist
ProList.Add(FProcessEntry32.szExeFile);
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
ShowMessage(ProList.Text );
finally
ProList.Free;
end;
end;