# VBForums CodeBank > CodeBank - Other >  [DELPHI] - Get running processes?

## Madboy

```
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

> ```
> procedure TForm1.Button1Click(Sender: TObject);
> var
> MyHandle: THandle;
> Struct: TProcessEntry32;
> begin
> try
> MyHandle:=CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
> Struct.dwSize:=Sizeof(TProcessEntry32);
> ...


thx alot for answeing my question  :Big Grin:   :Big Grin:  
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

how to i get process username ? please help me...

----------

