-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProcesses.vb
55 lines (47 loc) · 2.14 KB
/
Processes.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Public Class Processes
Dim Processes() As String = {"TrayIcon", "FullScreen", "MNSInterface", "TeacherConsole", "ScreenGrabber", "ADReader", "FastHookLoader_Win32", "IPCGrabber", "IPCGrabberU"}
Dim Selection As String
Private Sub Experiments_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Call Reset()
End Sub
Private Sub Eradicate_Click(sender As Object, e As EventArgs) Handles Eradicate.Click
On Error Resume Next
Dim myProcess As Process = System.Diagnostics.Process.GetProcessById(Val("&H" & Selection.Substring(0, Selection.IndexOf(" "))))
myProcess.Kill()
Call Reset()
End Sub
Public Sub Reset()
ListBox1.Items.Clear()
For Each p As Process In Process.GetProcesses
If Only.Checked Then
If Processes.Contains(p.ProcessName.ToString) Then
If p.Id = Process.GetCurrentProcess().Id Then
ListBox1.Items.Add("**" + p.Id.ToString("X8") + " " + p.ProcessName.ToString + "**")
Else
ListBox1.Items.Add(p.Id.ToString("X8") + " " + p.ProcessName.ToString)
End If
End If
Else
If p.Id = Process.GetCurrentProcess().Id Then
ListBox1.Items.Add("**" + p.Id.ToString("X8") + " " + p.ProcessName.ToString + "**")
Else
ListBox1.Items.Add(p.Id.ToString("X8") + " " + p.ProcessName.ToString)
End If
End If
Next
End Sub
Private Sub Only_CheckedChanged(sender As Object, e As EventArgs) Handles Only.CheckedChanged
Call Reset()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If Only.Checked Then
Call Reset()
End If
End Sub
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
Selection = ListBox1.SelectedItem
End Sub
Private Sub Refresh_Click(sender As Object, e As EventArgs) Handles RefreshBtn.Click
Call Reset()
End Sub
End Class