sp; StrCopy(ProcFile,fp32.szExeFile);
newitem1.caption:=ProcFile;
MyIcon.Handle:=ExtractAssociatedIcon(HINSTANCE,ProcFile,IconIndex);
if MyIcon.Handle<>0 then
begin
with lvSysProc do
begin
NewItem1.ImageIndex:=smallimages.addicon(MyIcon);
end;
end;
with newitem1.subitems do
begin
add(IntToHex(fp32.th32processid,4));
Add(IntToHex(fp32.th32ParentProcessID,4));
Add(IntToHex(fp32.pcPriClassBase,4));
Add(IntToHex(fp32.cntUsage,4));
Add(IntToStr(fp32.cntThreads));
end;
end;
clp:=process32next(fshandle,fp32);
end;
closehandle(fshandle);
lblCountSysProc.caption:=IntToStr(lvSysProc.items.count);
MyIcon.Free;
end;
procedure TForm1.btnDetermineClick(Sender: TObject);
var
processhndle:thandle;
begin
with lvSysProc do
begin
if selected=nil then
begin
messagebox(form1.handle,''请先选择要终止的进程!'',''操作提示'',MB_OK+MB_ICONINFORMATION);
end
else
begin
if messagebox(form1.handle,pchar(''终止''+itemfocused.caption+''?'')
,''终止进程'',mb_yesno+MB_ICONWARNING+MB_DEFBUTTON2)=mryes then
begin
idid:=strtoint(''