Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System
- Imports System.IO
- Imports System.Net
- Imports System.Web
- Imports System.Management
- Imports System.Net.Dns
- Public Class Form1
- Dim selecteditem As String = String.Empty
- Dim helditem As String = String.Empty
- Dim StoreIndex As Integer = 0
- Dim direct As String = My.Application.Info.DirectoryPath & "/"
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- 'was code here, i removed it... calls to a module for update purposes
- ListBox1.Items.Clear()
- End Sub
- Public Sub gettasks()
- ListBox1.Items.Clear()
- For Each p As Process In Process.GetProcesses
- If p.ProcessName.ToString <> "Idle" Then
- ListBox1.Items.Add(p.ProcessName.ToString)
- End If
- Next
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Call gettasks()
- End Sub
- Private Sub CheckedListBox1_SelectedIndexChanged(sender As Object, e As EventArgs)
- 'Dim x As String
- 'x = CheckedListBox1.GetItemChecked()
- 'MsgBox(CheckedListBox1.GetItemCheckState)
- End Sub
- Private Sub CheckedListBox1_ItemCheck(sender As Object, e As ItemCheckEventArgs)
- End Sub
- Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
- If CheckBox1.Checked = True Then
- Timer1.Start()
- Else
- Timer1.Stop()
- End If
- End Sub
- Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
- Call gettasks()
- ListBox1.SelectedIndex = StoreIndex
- If ListBox1.SelectedItem <> helditem Then
- 'RichTextBox1.AppendText("MATCH FAILURE" & ControlChars.NewLine & "ITEM INDEX: " & ListBox1.SelectedIndex & ControlChars.NewLine & "ITEM NAME: " & ListBox1.SelectedItem & ControlChars.NewLine)
- ListBox1.SelectedItem = helditem
- End If
- End Sub
- Private Sub KILLToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles KILLToolStripMenuItem.Click
- Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName(selecteditem)
- Dim result As String
- Try
- For Each p As Process In pProcess
- p.Kill()
- Next
- RichTextBox1.AppendText("PROCESS KILLED: " & selecteditem & ControlChars.NewLine)
- Catch ex As Exception
- result = MsgBox("THERE WAS AN ERROR STOPPING THE PROGRAM, WOULD YOU LIKE TO KNOW WHY?", MessageBoxButtons.YesNo)
- If result = vbYes Then
- MsgBox(ex.ToString)
- End If
- End Try
- Call gettasks()
- End Sub
- Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
- selecteditem = ListBox1.SelectedItem.ToString
- ToolStripTextBox1.Text = selecteditem
- StoreIndex = ListBox1.SelectedIndex
- End Sub
- Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
- Dim result As String
- Try
- Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName(helditem)
- If pProcess.Count > 0 Then
- For Each p As Process In pProcess
- p.Kill()
- Next
- RichTextBox1.AppendText("PROCESS KILLED: " & helditem & ControlChars.NewLine)
- End If
- Catch ex As Exception
- Timer2.Stop()
- RichTextBox1.AppendText("FAILED TO KILL: " & helditem & ControlChars.NewLine)
- result = MsgBox("THERE WAS AN ERROR STOPPING THE PROGRAM, WOULD YOU LIKE TO KNOW WHY?", MessageBoxButtons.YesNo)
- If result = vbYes Then
- MsgBox("COULD NOT KILL [" & helditem & "] BECAUSE" & ControlChars.NewLine & ex.ToString)
- End If
- End Try
- End Sub
- Private Sub HOLDToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles HOLDToolStripMenuItem1.Click
- helditem = selecteditem
- Timer2.Start()
- End Sub
- Private Sub PAUSEToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PAUSEToolStripMenuItem.Click
- Timer2.Stop()
- End Sub
- Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
- Label2.Text = "AVAILABLE MEMORY: " & System.Math.Round(My.Computer.Info.AvailablePhysicalMemory / (1024 * 1024)) & " mb"
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- RichTextBox1.Text = String.Empty
- ListBox1.Items.Clear()
- End Sub
- Private Sub SEARCHToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles SEARCHToolStripMenuItem1.Click
- Dim found As String
- For i = 0 To ListBox1.Items.Count - 1
- If ListBox1.Items(i) = ToolStripTextBox1.Text Then
- found = (ListBox1.Items(i).ToString)
- ListBox1.SetSelected(i, True)
- End If
- Next
- RichTextBox1.AppendText("PROCESS FOUND: " & found & ControlChars.NewLine)
- End Sub
- Private Sub ToolStripTextBox1_Click(sender As Object, e As EventArgs) Handles ToolStripTextBox1.Click
- End Sub
- Private Sub NumericUpDown1_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown1.ValueChanged
- Timer1.Interval = NumericUpDown1.Value * 1000
- End Sub
- Private Sub Button3_Click(sender As Object, e As EventArgs)
- Call getversion()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment