SetPriorityClass

Process ››
Parent Previous Next

Язык программирования FreeBasic

 

SetPriorityClass (API)

SetPriorityClass(hprocess,Prio)

Функция устанавливает приоритет выполнения процесса.

hprocess - хендл процесса, может быть получен функцией Open_Process.

Prio - Приоритет, который надо установить, возможные:

HIGH_PRIORITY_CLASS     -   128
IDLE_PRIORITY_CLASS      -    64
NORMAL_PRIORITY_CLASS    -  32
REALTIME_PRIORITY_CLASS    -  256
ABOVE_NORMAL_PRIORITY_CLASS    -  32768
BELOW_NORMAL_PRIORITY_CLASS    -  16384

Пример:


#Include "window9.bi"
Dim As HANDLE hpr,pr=InitProcess
If pr<>-1 And FirstProcess(pr)<>0 Then
 Do
  hpr=Open_Process(GetIDProcess())
  If LCase(GetNameProcess())="fbtemp.exe" Then SetPriorityClass(hpr,64)
 Loop Until  NextProcess(pr)=0
 CloseHandle(pr): CloseHandle(hpr)
EndIf
Sleep



http://mneniya.ucoz.ru/

Created with the Personal Edition of HelpNDoc: Easily create Help documents