|
Func _ProcessGetName( $i_PID )
If Not ProcessExists($i_PID) Then
SetError(1)
Return ''
EndIf
Local $a_Processes = ProcessList()
If Not @error Then
For $i = 1 To $a_Processes[0][0]
If $a_Processes[$i][1] = $i_PID Then Return $a_Processes[$i][0]
Next
EndIf
SetError(1)
Return ''
EndFunc
Func _ProcessGetPriority($vProcess)
Local $i_PID = ProcessExists($vProcess)
If Not $i_PID Then
SetError(1)
Return -1
EndIf
Local $hDLL = DllOpen('kernel32.dll')
Local $aProcessHandle = DllCall($hDLL, 'int', 'OpenProcess', 'int', 0x0400, 'int', False, 'int', $i_PID)
Local $aPriority = DllCall($hDLL, 'int', 'GetPriorityClass', 'int', $aProcessHandle[0])
DllCall($hDLL, 'int', 'CloseHandle', 'int', $aProcessHandle[0])
DllClose($hDLL)
Switch $aPriority[0]
Case 0x00000040
Return 0
Case 0x00004000
Return 1
Case 0x00000020
Return 2
Case 0x00008000
Return 3
Case 0x00000080
Return 4
Case 0x00000100
Return 5
Case Else
SetError(1)
Return -1
EndSwitch
EndFunc
Func _RunDOS($sCommand)
Return RunWait(@ComSpec & " /C " & $sCommand, "", @SW_HIDE)
EndFunc
$rc = _RunDos("gpupdate /force /wait:100")
Exit |
|