Gets or sets the overall priority category for the associated process.
Assembly: System (in System.dll)
[<MonitoringDescriptionAttribute("ProcessPriorityClass")>] member PriorityClass : ProcessPriorityClass with get, set
Process priority information could not be set or retrieved from the associated process resource.
The process identifier or process handle is zero. (The process has not been started.)
You are attempting to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer.
The process Id is not available.
You have set the to AboveNormal or BelowNormal when using Windows 98 or Windows Millennium Edition (Windows Me). These platforms do not support those values for the priority class.
Priority class cannot be set because it does not use a valid value, as defined in the ProcessPriorityClass enumeration.
A process priority class encompasses a range of thread priority levels. Threads with different priorities that are running in the process run relative to the priority class of the process. Win32 uses four priority classes with seven base priority levels per class. These process priority classes are captured in the ProcessPriorityClass enumeration, which lets you set the process priority to Idle, Normal, High, AboveNormal, BelowNormal, or RealTime. Based on the time elapsed or other boosts, the base priority level can be changed by the operating system when a process needs to be put ahead of others for access to the processor. In addition, you can set the PriorityBoostEnabled to temporarily boost the priority level of threads that have been taken out of the wait state. The priority is reset when the process returns to the wait state.
The BasePriority property lets you view the starting priority that is assigned to a process. However, because it is read-only, you cannot use the BasePriority property to set the priority of a process. To change the priority, use the property, which gets or sets the overall priority category for the process.
The priority class cannot be viewed using System Monitor. The following table shows the relationship between the BasePriority and values.
The following example starts an instance of Notepad. The example then retrieves and displays various properties of the associated process. The example detects when the process exits, and displays the process's exit code.
for full trust for the immediate caller. This member cannot be used by partially trusted code.