Jamie Lyndon
Jamie Lyndon

Reputation: 1

Is there an effective way to find the cpu priority for a process?

I'm trying to make a simplified task manager to use in school that allows a student to manage and view the processes they're running.

I want the program to be able to show the user what priority a certain process is running with.

I currently have it set up so the user can change all the priorities but cant see the changes they have made.

Will I need to store all the changes they made in an array that follows alongside all the processes and set them all to normal then just shows what they have changed.

I don't really want to do this as it is inefficient and unnecessarily complicated.

Upvotes: 0

Views: 114

Answers (1)

AleRubis
AleRubis

Reputation: 264

You can use System.Diagnostics.Process Class which has a property named PriorityClass.

For example the following code gets the priority of the current process:

Dim proc As Process = Process.GetCurrentProcess()
Dim procPriority = proc.PriorityClass

Here you can find all the possible values: https://msdn.microsoft.com/en-us/library/system.diagnostics.processpriorityclass.aspx

Upvotes: 2

Related Questions