Obtient la priorit� d'un processus ouvert
#include <Process.au3>
_ProcessGetPriority ( $vProcess )
$vProcess | Le nom ou le PID du processus � examiner. |
Succ�s: | Retourne un nombre entier corressponding � la priorit� des processus: 0 - En pause/Bas 1 - Inf�rieure � la normale 2 - Normale 3 - Au dessus de la normale 4 - Haute 5 - En temps r�el |
�chec: | Retourne -1 et d�finit @error <> 0. |
#include <MsgBoxConstants.au3> #include <Process.au3> Local $i_Priority_Level, $i_Notepad_PID, $i_ArrayItem Local $a_RunLevels[3] = [0, 2, 4] ; Les priorit�s hautes et basses, normales ; Obtient le niveau de priorit� de cette instance de AutoIt Scripting Engine $i_Priority_Level = _ProcessGetPriority(@AutoItPID) MsgBox($MB_SYSTEMMODAL, "AutoIt Script", "Doit �tre 2: " & $i_Priority_Level) $i_Notepad_PID = Run(@ComSpec & '/k notepad.exe', '', @SW_HIDE) For $i_ArrayItem = 0 To 2 ProcessSetPriority($i_Notepad_PID, $a_RunLevels[$i_ArrayItem]) $i_Priority_Level = _ProcessGetPriority($i_Notepad_PID) MsgBox($MB_SYSTEMMODAL, "Notepad Priority", "Doit �tre " & $a_RunLevels[$i_ArrayItem] & ": " & $i_Priority_Level) Next ProcessClose('notepad.exe')