kklf:下面程序能否大道你的要求:
procedure TForm1.Button1Click(Sender: TObject);
VAR
pe
ROCESSENTRY32;
me:MODULEENTRY32;
hp,hm,hdd,ppp:Thandle;
b,b1:boolean;
begin
hp:=CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS,0);
pe.dwSize:=SizeOf(pe);
b:=Process32First(hp,pe);
while bdo
begin
hm:=CreateToolHelp32SnapShot(TH32CS_SNAPModule,pe.th32ProcessID);
me.dwSize:=sizeof(ModuleEntry32);
if Module32First(hm,me) then
begin
b1:=Module32First(hm,me);
while b1do
begin
if me.th32ModuleID=pe.th32ModuleID then
begin
listbox1.Items.AddObject(me.szExePath,Tobject(pe.th32ProcessID));
end;
b1:=Module32Next(hm,me);
end;
end;
b:=Process32Next(hp,pe);
end;
end;
procedure TForm1.ListBox1DblClick(Sender: TObject);
var
pe
ROCESSENTRY32;
PPP:Thandle;
begin
pe.th32ProcessID:=Cardinal(listbox1.Items.Objects[listbox1.ItemIndex]);
ppp:=OpenProcess(PROCESS_ALL_ACCESS, FALSE,
pe. th32ProcessID);
TerminateProcess(ppp,0);
listbox1.Items.Delete(listbox1.ItemIndex);
end;