Thursday, July 16, 2009

Get Current Running Process in Listbox

This program will show all the running process in a listbox.
Open project as windows application and add one listbox and one button there.
Form will look like this


Now double click the button and just copy paste or write the following code inside button1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim plist() As Process
Dim myprocess As System.Diagnostics.Process
plist = Process.GetProcesses
ListBox1.Items.Clear()

For Each myprocess In plist
ListBox1.Items.Add(myprocess.ProcessName)
Next
End Sub

Now Run the program and click the button1.

0 comments:

Post a Comment