◇[DELPHI]列举当前系统运行进程 uses TLHelp32; procedure TForm1.Button1Click(Sender: TObject); var lppe: TProcessEntry32; found : boolean; Hand : THandle; begin Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL,0); found := Process32First(Hand,lppe); while found do begin ListBox1.Items.Add(StrPas(lppe.szExeFile)); found := Process32Next(Hand,lppe); end; end;
zswang(伴水)(现在是专家门诊清洁工) 你怎么又回来了。好久不见你,红星闪闪。
取得系统运行的进程名 var hCurrentWindow:HWnd;szText:array[0..254] of char; begin hCurrentWindow:=Getwindow(handle,GW_HWndFrist); while hCurrentWindow <> 0 do begin if Getwindowtext(hcurrnetwindow,@sztext,255)>0 then listbox1.items.add(strpas(@sztext)); hCurrentWindow:=Getwindow(hCurrentwindow,GW_HWndNext); end; end;列举当前系统运行进程 uses TLHelp32; procedure TForm1.Button1Click(Sender: TObject); var lppe: TProcessEntry32; found : boolean; Hand : THandle; begin Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL,0); found := Process32First(Hand,lppe); while found do begin ListBox1.Items.Add(StrPas(lppe.szExeFile)); found := Process32Next(Hand,lppe); end; end;
http://jp.njuct.edu.cn/crystal/uploadtools/DELPHI_skills.htm
uses TLHelp32;
procedure TForm1.Button1Click(Sender: TObject);
var lppe: TProcessEntry32;
found : boolean;
Hand : THandle;
begin
Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);
found := Process32First(Hand,lppe);
while found do
begin
ListBox1.Items.Add(StrPas(lppe.szExeFile));
found := Process32Next(Hand,lppe);
end;
end;
var hCurrentWindow:HWnd;szText:array[0..254] of char;
begin
hCurrentWindow:=Getwindow(handle,GW_HWndFrist);
while hCurrentWindow <> 0 do
begin
if Getwindowtext(hcurrnetwindow,@sztext,255)>0 then listbox1.items.add(strpas(@sztext));
hCurrentWindow:=Getwindow(hCurrentwindow,GW_HWndNext);
end;
end;列举当前系统运行进程
uses TLHelp32;
procedure TForm1.Button1Click(Sender: TObject);
var lppe: TProcessEntry32;
found : boolean;
Hand : THandle;
begin
Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);
found := Process32First(Hand,lppe);
while found do
begin
ListBox1.Items.Add(StrPas(lppe.szExeFile));
found := Process32Next(Hand,lppe);
end;
end;