Sets the specified thread priority.
[ bSet = ] SetThreadPriority ( hThread, enPriority )
The SetThreadPriority property syntax has the following parts:
Name |
Type |
Description |
bSet |
Bool Public |
A Boolean expression specifying whether the specified thread priority was set. |
hThread |
Val AHandle |
Handle to the thread. |
enPriority |
Val enumAThreadPriority |
An integer specifying the new thread priority level within its priority class. |
bSet can have one of the following values:
Value |
Description |
True * |
The thread priority was set. |
False |
The thread priority was not set. |
Name |
Value |
Description |
apriorityIdle |
-15 |
Idle |
apriorityLowest |
-2 |
Lowest |
apriorityBelowNormal |
-1 |
Below Normal |
apriorityNormal |
0 |
Normal |
apriorityAboveNormal |
1 |
Above Normal |
apriorityHighest |
2 |
Highest |
apriorityTimeCritical |
15 |
Time Critical |
This function sets the priority level of the current thread within its priority class. It can only be called after CreateThread successfully returns.
The following statement sets the priority of the Thread1 to be normal:
bSetThreadPriority1 = SetThreadPriority(hThread1,apriorityNormal)