DWORD GetPriorityClass(HANDLE HandleProcessus);
Le résultat est soit ABOVE_NORMAL_PRIORITY_CLASS, BELOW_NORMAL_PRIORITY_CLASS, HIGH_PRIORITY_CLASS, IDLE_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS ou REALTIME_PRIORITY_CLASS.
#include <windows.h>
#include <winbase.h>
HANDLE Handle;
DWORD Priorite;
Priorite=GetPriorityClasse(Handle);
if (!Priorite)
{
...
}
...
if (!SetPriorityClass(Handle, ABOVE_NORMAL_PRIORITY_CLASS))
{
...
}
...
SetPriorityClass(Handle, Priorite);
...