已知线程句柄如何获得线程号?

hit_ql 2007-04-20 09:28:06
我的程序是在win2000下,如何用已知线程句柄获得线程号?
...全文
338 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
woaimm123456 2007-04-26
  • 打赏
  • 举报
回复
得到当前线程ID:GetCurrentThreadId()
DoItFreely 2007-04-24
  • 打赏
  • 举报
回复
如果可能的话,调度一个APC让那个线程去调GetCurrentThreadId(),不能用APC的话试试SetThreadContext()
晨星 2007-04-20
  • 打赏
  • 举报
回复
哦,好像是不行,要server版的。- -b
hit_ql 2007-04-20
  • 打赏
  • 举报
回复
GetThreadId()在win2000下可以使用么?
在我的msdn里为什么没有GetThreadId()?
尘雨 2007-04-20
  • 打赏
  • 举报
回复
写错了
DWORD GetThreadId(
HANDLE Thread
);

尘雨 2007-04-20
  • 打赏
  • 举报
回复
void GetThreadId(
HANDLE Thread
);

晨星 2007-04-20
  • 打赏
  • 举报
回复
GetThreadId
The GetThreadId function retrieves the thread identifier of the specified thread.

DWORD GetThreadId(
HANDLE Thread
);

Parameters
Thread
[in] Handle to the thread. The handle must have the THREAD_QUERY_INFORMATION access right. For more information about access rights, see Thread Security and Access Rights.
Return Values
If the function succeeds, the return value is the thread identifier of the specified thread.


If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks
Until a thread terminates, its thread identifier uniquely identifies it on the system.

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧