Click here to Skip to main content
15,903,385 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have been looking around for this answer for some time now how do you set the prioty of a running program in vb.net so for example notepad?
Please help I can't find the answer anywere. :doh:
Posted
Updated 21-Jun-10 21:28pm
v2

1 solution

This link shows us ways to do this through unmanaged code.

You could use the process class to access a process and then set the priority for e.g. something like
VB
Dim myprocess As New System.Diagnostics.Process()
myprocess.StartInfo.FileName = "C:\myprogram.exe"
myprocess.Start()
myprocess.PriorityClass = ProcessPriorityClass.High
Environment.Exit(1)
 
Share this answer
 
Comments
christian_king 22-Jun-10 11:08am    
This dosent work it opens up notepad and changes the priority to high. But how do you set the priority of a program that is already opened to high?
Thank You :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900