(注意uses TLHelp32) 然后 var lppe: TProcessEntry32; found : boolean; Hand : THandle; begin Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL 0); found := Process32First(Hand lppe); while found do begin ListBox.Items.Add(StrPas(lppe.szExeFile));//列出所有进程。 found := Process32Next(Hand lppe); end; end;
然后
var lppe: TProcessEntry32;
found : boolean;
Hand : THandle;
begin
Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL 0);
found := Process32First(Hand lppe);
while found do
begin
ListBox.Items.Add(StrPas(lppe.szExeFile));//列出所有进程。
found := Process32Next(Hand lppe);
end;
end;