请输入您要查询的百科知识:

 

词条 SetThreadPriority
释义

VB声明

Declare Function SetThreadPriority Lib "kernel32" Alias "SetThreadPriority" (ByVal hThread As Long, ByVal nPriority As Long) As Long

说明

设定线程的优先级别

返回值

Long,非零表示成功,零表示失败。会设置GetLastError

参数表

参数 类型及说明

hThread Long,线程句柄

nPriority Long,返回带有THREAD_PRIORITY_???前缀的某个函数,它定义了线程的优级。

注解

线程的优先级同进程的优先级类组合在一起就决定了线程的实际优先级

VC声明

BOOL SetThreadPriority(

HANDLE hThread, // handle to the thread

int nPriority // thread priority level

);

功能说明

设置指定线程的优先级

参数说明

hThread 要设置的线程句柄

nPriority 优先级别参数 可设置为一下参数

THREAD_PRIORITY_ABOVE_NORMAL 为比一般优先级高一个等级

THREAD_PRIORITY_BELOW_NORMAL 比一般低一个等级

THREAD_PRIORITY_HIGHEST 比一般高2个等级

THREAD_PRIORITY_IDLE

THREAD_PRIORITY_LOWEST 比一般低2个等级

THREAD_PRIORITY_NORMAL 一般等级

THREAD_PRIORITY_TIME_CRITICAL

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/2/6 0:15:46