Kernel32SetThreadPriority Method
Sets the priority value for the specified thread.
This value, together with the priority class of the thread's process,
determines the thread's base priority level.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll")]
public static bool SetThreadPriority(
IntPtr hThread,
ThreadPriorityLevel nPriority
)
<DllImportAttribute("Kernel32.dll">]
Public Shared Function SetThreadPriority (
hThread As IntPtr,
nPriority As ThreadPriorityLevel
) As Boolean
Dim hThread As IntPtr
Dim nPriority As ThreadPriorityLevel
Dim returnValue As Boolean
returnValue = Kernel32.SetThreadPriority(hThread,
nPriority)
public:
[DllImportAttribute(L"Kernel32.dll")]
static bool SetThreadPriority(
IntPtr hThread,
ThreadPriorityLevel nPriority
)
[<DllImportAttribute("Kernel32.dll")>]
static member SetThreadPriority :
hThread : IntPtr *
nPriority : ThreadPriorityLevel -> bool
No code example is currently available or this language may not be supported.
- hThread IntPtr
-
A handle to the process.
This handle must be created with the SetInformation
or SetLimitedInformation access right.
- nPriority ThreadPriorityLevel
-
The priority value for the thread.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.