Can anyone provide a Delphi example of code that changes the priority class of a process?
I need to get the process by name from the Windows XP Task manager and change its priority using delphi code.
You can change the scheduling priority of a running process to a value lower or higher than the base scheduling priority by using the renice command from the command line. This command changes the nice value of a process.
Right-click on your selected process and navigate to Set priority. This drops down a sub-menu listing all the priority levels. Select the intended level (Below normal in our example).
you must use the SetPriorityClass function.
This function is part of the windows unit, this is a sample
SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With