procedure getProcesslist(ss: TStrings);
var
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
Ret: BOOL;
begin
ss.Clear;
FSnapshotHandle := CreateToolhelp32Snapshot(
TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
Ret := Process32First(FSnapshotHandle, FProcessEntry32);
while Ret do
begin
ss.Add(Format('%s=%s', [IntToStr(FProcessEntry32.th32ProcessID), (FProcessEntry32.szExeFile)]));
Ret := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;
??