Yes. There are both Win32 and .NET APIs. Typically, though, normal processes/threads can only reduce their priority. You need to be privileged to elevate your priority.
tvanfosson
2008-11-03 03:29:01
Yes. There are both Win32 and .NET APIs. Typically, though, normal processes/threads can only reduce their priority. You need to be privileged to elevate your priority.
The Win32 APIs for setting priority are:
SetThreadPriority ( http://msdn.microsoft.com/en-us/library/aa394494.aspx ) and
SetPriorityClass ( http://msdn.microsoft.com/en-us/library/ms686219(VS.85).aspx )
The SetPriorityClass selects the range of priorities available to a process and the SetThreadPriority sets the relative priority within the class.
obviously you need the appropriate access rights to change the priority.