PDA

Click to See Complete Forum and Search --> : [DELPHI] - Get running processes?


Madboy
Jul 21st, 2005, 03:29 PM
procedure TForm1.Button1Click(Sender: TObject);
var
MyHandle: THandle;
Struct: TProcessEntry32;
begin
try
MyHandle:=CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
Struct.dwSize:=Sizeof(TProcessEntry32);
if Process32First(MyHandle, Struct) then
ListBox1.Items.Add(Struct.szExeFile);
while Process32Next(MyHandle, Struct) do
ListBox1.Items.Add(Struct.szExeFile);
except on exception do
ShowMessage('Error showing process list');
end
end;

Shady Soft
Jul 21st, 2005, 03:39 PM
procedure TForm1.Button1Click(Sender: TObject);
var
MyHandle: THandle;
Struct: TProcessEntry32;
begin
try
MyHandle:=CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
Struct.dwSize:=Sizeof(TProcessEntry32);
if Process32First(MyHandle, Struct) then
ListBox1.Items.Add(Struct.szExeFile);
while Process32Next(MyHandle, Struct) do
ListBox1.Items.Add(Struct.szExeFile);
except on exception do
ShowMessage('Error showing process list');
end
end;
thx alot for answeing my question :D :D
but i found what i was looking for :blush:
- I have a loooooooooot of Delphi questions..But i don't think that i can post them in the Code Bank..Is there is a Forum in This Forums that i can post delphi questions??

estergon85
Apr 29th, 2007, 10:29 AM
how to i get process username ? please help me...