This Article will make you understand that how to get a List of Active Windows and the Processes which they are associated with, how you can Destroy the selected process. Following are the Steps
Private Sub btnDestroy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDestroy.Click Try Dim whole As String = lstMain.SelectedItem.ToString Dim pid = whole.Substring(whole.LastIndexOf(" # ")) pid = pid.Replace(" # ", "") Dim p As Process = Process.GetProcessById(pid) Try p.Kill() Catch ex As Exception MessageBox.Show(ex.Message) End Try Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub Output