C++11 的标准库包含<thread>
它允许创建线程。但是,Windows api 需要某些函数的 ID(帖子主题消息,即)。我怎么才能得到它?
remark: std::thread::get_id()
似乎不起作用:
PostThreadMessage(m_thread->get_id(), WM_QUIT, 0, 0);
e:\documents\khook\khooker\hook_runner.cpp(129): error C2664: 'PostThreadMessageW' : cannot convert parameter 1 from 'std::thread::id' to 'DWORD'
使用成员函数native_handle()。它提供本机线程句柄。然后你可以打电话GetThreadId()
on it.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)