Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System
- Imports System.Diagnostics
- Imports System.ComponentModel
- Public Class mainForm
- #Region " VARIABLES "
- Public PID As Integer
- Public Proc_PID As Process()
- Public fproc As Process
- #End Region
- Private Sub NFI_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NFI.MouseDoubleClick
- Me.Visible = True
- Me.WindowState = FormWindowState.Normal
- End Sub
- Private Sub mainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- GetPid()
- End Sub
- Sub GetPid()
- Dim index As Integer = 0
- Proc_PID = Process.GetProcesses()
- For Each Process In Proc_PID
- PIDSelect.Items.Add(Proc_PID(index).Id & " - " & Proc_PID(index).MainWindowTitle)
- index += 1
- Next
- PIDSelect.SelectedIndex = 0
- End Sub
- Sub SetPID()
- PID = Proc_PID(PIDSelect.SelectedIndex).Id
- fproc = Process.GetProcessById(PID)
- End Sub
- Private Sub mainForm_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
- NFI.Visible = False
- End Sub
- Private Sub mainForm_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize
- If Me.WindowState = FormWindowState.Minimized Then
- Me.Visible = False
- Me.ShowInTaskbar = False
- NFI.Visible = True
- End If
- If Me.WindowState = FormWindowState.Normal Then
- NFI.Visible = False
- Me.ShowInTaskbar = True
- End If
- End Sub
- Private Sub startP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startP.Click
- startP.Enabled = False
- stopP.Enabled = True
- sysTimer.Interval = Int32.Parse(sysTime.Text) * 1000
- sysTimer.Start()
- End Sub
- Private Sub stopP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles stopP.Click
- startP.Enabled = True
- stopP.Enabled = False
- sysTimer.Stop()
- End Sub
- Private Sub sysTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sysTimer.Tick
- SetPID()
- Process.GetProcessById(PID).PriorityClass = ProcessPriorityClass.AboveNormal
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement