Question Get Running Applications

Pirahnaplant

Well-known member
Joined
Mar 29, 2009
Messages
75
Programming Experience
3-5
How can I get all of the running applications? If I have to use Process.GetProcesses, then how can I determine which are applications (appear in the task bar)?
 
MainWindowTitle property could be a good indication.
 
I beleive there is a enumwindows api that will allow you to fill a listbox with all the windows.

VB.NET:
Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Int32, ByVal lParam As Int32) As Int32
 
Last edited:
Sorry, it looks like that API can only be used in vb6. But i beleive you could also use the System.Diagnostics namespace, and the getproccesses class.

VB.NET:
    Sub FillListBoxWithProcesses()
        'Declares Processes as an array filled with all processes
        Dim process() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcesses()
        Dim i As Integer = 0
        For i = 0 To process.GetUpperBound(0)
            ProcessListBox.Items.Add(process(i).ProcessName)
        Next
    End Sub

And now all you have to do is change the ProcessListBox to your listbox, and then call FillListBoxWithProcesses and you have a listbox with all your processes :)

I could not find anything about the task bar though. Im sure you could get the HWND of the window through that code, and then see if it is visible.... ask if you need some help with that.
If this helped, please add rep.
thanks :)
 
Back
Top