List all running applications

BusterG

Newcomer
Joined
Jan 11, 2003
Messages
15
Location
United Kingdom
I am using VB.Net and would like to obtain a list of all the running applications on a PC.

I have looked at the Process Class but don't know if this is the right/best/simplest way of achieveing what I want.

I only need to list items with user interfaces (windows) not services.

Any ideas apreciated.

I meant to post this in the VB.Net forum Duh!
 
Last edited:
instance.GetProcesses() will return you an array of all the processes running on a machine.
Then, you can use MainWIndowHandle property of each process to find out if it has an interface. If it doesn't, this property will be 0.
 
A posting that someone else sugested was as follows:

*****
Put a Listbox on a form, and add this to Form_Load:

Dim current As Process = Process.GetCurrentProcess()
Dim processes As Process() = Process.GetProcesses

Dim ThisProcess As Process
For Each ThisProcess In processes
'-- Ignore the current process
If ThisProcess.Id <> current.Id Then
'-- Only list processes that have a Main Window Title
If ThisProcess.MainWindowTitle <> "" Then
ListBox1.Items.Add(ThisProcess.ProcessName)
End If
End If
Next
*****

Olechko, as you said, GetProcesses returns an array which you can then itterate and return the running appications.
 
Back
Top