我需要这个句柄来调用WaitForSingleObject,大家帮帮忙。
解决方案 »
- [100]getResponseHeader()使用求助
- 这个。。该怎么赚钱。。。。
- (const unsigned char *)"5" 什么意思
- 收购!急
- 在程序中怎么直接运行DOS的内部和外部命令???
- 请问大家,如何在一个视里面同时操作两个数据表啊?书上只说一个视类对一个表类,能不能统一在一个视中操作呢?
- 在钩子里如何屏蔽一个按键消息?
- 请问关于程序开始画面的问题 高分请教
- 怎样做列表框呀?
- 请大家快去http://www.csdn.net/expert/topic/463/463801.shtm救我一命吧!
- 怎么用程序实现ALT+PRINTSCRREN的功能对当前窗口截屏?然后在保存下来~~~
- 请问那里有msvc1.0下载呀!急需!请帮帮我!(24小时在线)
There is no way to get the thread handle from the thread ID. While there is an OpenProcess() API that takes a PID and returns the handle to the process, there is no corresponding OpenThread() that takes a thread ID and returns a thread handle.
HANDLE OpenThread(
DWORD dwDesiredAccess, // access right
BOOL bInheritHandle, // handle inheritance option
DWORD dwThreadId // thread identifier
);
你是怎么创建线程的?如果是afxbeginthread
那么cwinthread就有m_hThread这个成员啊,它就
是个handle
Requirements
Windows NT/2000/XP: Included in Windows 2000 and later.
Windows 95/98/Me: Included in Windows Me.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.我是用CreateProcess新建进程打开一个文件的,可是很多程序如果系统里已经有一个进程,新开的进程就会马上结束,原来的进程会新开一个线程来打开这个文件,我就想要得到这个线程的句柄。我现在是枚举窗口,找到打开我的文件的窗口以后调用GetWindowThreadProcessId来得到线程的Id,可是我必须要有线程的句柄才能用来调用WaitForSingleObject..
HANDLE GetCurrentThread(VOID);