Scalabium Software |
|
| Knowledge for your independence'. | |
#4: How can I get a list of processes which was ran on a system? |
|
Using next procedure you can display the text with any angle.
Today I answered on question with same subject by e-mail to Marcus Monaghan and I sure, that this example will useful for someone else.
procedure TForm1.Button1Click(Sender: TObject);
var handler: THandle;
data: TProcessEntry32;
function GetName: string;
var i:byte;
begin
Result := '';
i := 0;
while data.szExeFile[i] <> '' do
begin
Result := Result + data.szExeFile[i];
Inc(i);
end;
end;
begin
handler := CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0);
if Process32First(handler, data) then
begin
listbox1.Items.Add(GetName());
while Process32Next(handler, data) do
listbox1.Items.Add(GetName());
end
else
ShowMessage('Error');
end;
|
|
|
Copyright© 1998-2025, Scalabium
Software. All rights reserved. |