I am trying to check for certain processes that is running and then inform the user of those processes via textbox like "The programs; -name of the processes running goes here- are running"
The I am using is
Dim iIndex As Integer
Dim isd As Integer = 0
iIndex = Dialog1.ListBox1.FindStringExact("msaccess")
If iIndex <> -1 Then
Dialog1.ListBox1.SelectedIndex = iIndex
Dialog1.ListBox1.TopIndex = iIndex
textbox.Text = textbox.Text & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & " -> MS Access"
Else
isd += 1
End If
iIndex = Dialog1.ListBox1.FindStringExact("excel")
If iIndex <> -1 Then
Dialog1.ListBox1.SelectedIndex = iIndex
Dialog1.ListBox1.TopIndex = iIndex
textbox.Text = textbox.Text & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & " -> MS Excel"
Else
isd += 1
End If
iIndex = Dialog1.ListBox1.FindStringExact("wmplayer")
If iIndex <> -1 Then
Dialog1.ListBox1.SelectedIndex = iIndex
Dialog1.ListBox1.TopIndex = iIndex
textbox.Text = textbox.Text & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & " -> Windows Media Player"
Else
isd += 1
End If
iIndex = Dialog1.ListBox1.FindStringExact("powerpoint")
If iIndex <> -1 Then
Dialog1.ListBox1.SelectedIndex = iIndex
Dialog1.ListBox1.TopIndex = iIndex
textbox.Text = textbox.Text & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & " -> MS Powerpoint"
Else
isd += 1
End If
iIndex = Dialog1.ListBox1.FindStringExact("winword")
If iIndex <> -1 Then
Dialog1.ListBox1.SelectedIndex = iIndex
Dialog1.ListBox1.TopIndex = iIndex
textbox.Text = textbox.Text & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & " -> MS Word"
Else
isd += 1
End If
If isd <> 0 Then
textbox.Text = textbox.Text & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & " -> NONE :)"
End If
Private Sub getallproc(ByVal lst As ListBox)
Dim ProcessList As System.Diagnostics.Process()
ProcessList = System.Diagnostics.Process.GetProcesses()
Dim Proc As System.Diagnostics.Process
For Each Proc In ProcessList
lst.Items.Add(Proc.ProcessName.ToLower) ' & Proc.Id)
Next
End Sub
I know its a bit confusing but I have no idea i can do this in any other way if you guys know please let me know how it may be posible. My code does not work :(