var lppe: TProcessEntry32; found : boolean; Hand : THandle; begin Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL,0); lppe.dwSize :=sizeof(TProcessEntry32); found := Process32First(Hand,lppe); while found do begin ListBox.Items.Add(StrPas(lppe.szExeFile)); found := Process32Next(Hand,lppe); end; end;
GetCurrentThread
http://www.alexfedotov.com/articles/enumproc.asp
uses TLHelp32;...
var lppe: TProcessEntry32;
found : boolean;
Hand : THandle;
begin
Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);
lppe.dwSize :=sizeof(TProcessEntry32);
found := Process32First(Hand,lppe);
while found do
begin
ListBox.Items.Add(StrPas(lppe.szExeFile));
found := Process32Next(Hand,lppe);
end;
end;