Function Reference


_WinAPI_SetPriorityClass

Sets the priority class for the specified process

#include <WinAPIProc.au3>
_WinAPI_SetPriorityClass ( $iPriority [, $iPID = 0] )

Parameters

$iPriority The priority class for the process. This parameter can be one of the following values.
$ABOVE_NORMAL_PRIORITY_CLASS
$BELOW_NORMAL_PRIORITY_CLASS
$HIGH_PRIORITY_CLASS
$IDLE_PRIORITY_CLASS
$NORMAL_PRIORITY_CLASS
$REALTIME_PRIORITY_CLASS

Windows Vista or later
$PROCESS_MODE_BACKGROUND_BEGIN
$PROCESS_MODE_BACKGROUND_END
$iPID [optional] The PID of the process. Default (0) is the current process.

Return Value

Success: True
Failure: False

See Also

Search SetPriorityClass in MSDN Library.

Example

#include <APIProcConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIProc.au3>
#include <WinAPIShPath.au3>

Run(@SystemDir & '\taskmgr.exe')
Sleep(1000)

_WinAPI_SetPriorityClass($HIGH_PRIORITY_CLASS)
MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), '', 'Look what priority class has the "' & _WinAPI_PathStripPath(FileGetLongName(@AutoItExe)) & '" (' & @AutoItPID & ') process.' & @CRLF & @CRLF & 'Should be "High".')

_WinAPI_SetPriorityClass($IDLE_PRIORITY_CLASS)
MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), '', 'Look what priority class has the "' & _WinAPI_PathStripPath(FileGetLongName(@AutoItExe)) & '" (' & @AutoItPID & ') process.' & @CRLF & @CRLF & 'Should be "Low".')