List of running applications in .Net
-
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 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.
Don't worry, someone posted the following code sample which solved my problem: 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