或者枚举进程
procedure listpro;
var lppe: TProcessEntry32;
found : boolean;
Hand: THandle;
s,s1:string;
begin
Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);
found := Process32First(Hand,lppe);
while found do begin
s:=StrPas(lppe.szExeFile);
s1:=inttostr(lppe.th32ProcessID);
found := Process32Next(Hand,lppe);
form2.ListBox.Items.Add('进程名称:'+s+' 进程ID ::'+S1);
end;
end;