SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS)
#define NORMAL_PRIORITY_CLASS 0x00000020
#define IDLE_PRIORITY_CLASS 0x00000040
#define HIGH_PRIORITY_CLASS 0x00000080
#define REALTIME_PRIORITY_CLASS 0x00000100
idle 空闲,数字优先级4,CreateProcess创建标识IDLE_PRIORITY_CLASS
normal 普通,数字优先级8,创建标识NORMAL_PRIORITY_CLASS
high 高,数字优先级13,创建标识HIGH_PRIORITY_CLASS
realtime 实时,数字优先级24,创建标识REALTIME_PRIORITY_CLASS;
通过API函数、GetPriorityClass函数和SetPriority函数可以获取或设置进程的优先级类别。一般程序会将进程的优先级设为普通。
高优先级的很少,如桌面管理器,空闲进程主要用于系统监控。实时优先级几乎从来不用。
参考: http://www.cnblogs.com/huandi/archive/2010/05/20/1740492.html