Order and save right now!
20% off with the 729824315 dicscount code for Ultimate Pack and any another product for Delphi from Greatis Programming! |
⤷ Get list of the win32 processes
Use CreateToolHelp32SnapShot function with TH32CS_SNAPPROCESS parameter for getting snapshot of Win32 processes. And use Process32First and Process32Next for getting information about these processes.Don't forget to add TLHelp32 to the uses chapter.
uses TLHelp32;
...
procedure TForm1.Button1Click(Sender: TObject);
var
MyHandle: THandle;
Struct: TProcessEntry32;
begin
MyHandle:=CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
Struct.dwSize:=Sizeof(TProcessEntry32);
if Process32First(MyHandle, Struct) then
Memo1.Lines.Add(Struct.szExeFile);
while Process32Next(MyHandle, Struct) do
Memo1.Lines.Add(Struct.szExeFile);
end;
-
More for developers