|I have some code, it works, no errors, But I don't know how to add to important features to it|
Keep in mine that I'm using notepad as an example.
A loop, This loop will keep looping until the process has been set to high priority, and once it's beem set it'll continue with the rest of the program.
Problem:When I add my loop, It eats 1/2 my CPU, and freezes the program, so you can't use or press any buttons in it, please help me.
Private Sub ProcessHigh()
Dim pslist() As Process
If Process.GetProcessesByName("notepad").Length = 0 Then
ListBox1.Items.Add("Waiting For Notepad.exe")
psList = Process.GetProcesses()
For Each p As Process In psList
If p.ProcessName = "notepad" Then
p.PriorityClass = ProcessPriorityClass.High
ListBox1.Items.Add("Notepad.exe Has Been Set to high Priority")
So all I need is for this to be looped, to only say waiting for notepad once, keep looping until it's notepad had been set to high priority
Can i add the sleep function into the code, so it'll loop every 2 seconds, will this reduce the CPU consumption?