c++ - How to get the winapi id of a thread that has been created using the standard library? -
c++11’s standard library contains <thread> allows threads created. however, windows api requires id functions (postthreadmessage, namely). how can it?
remark: std::thread::get_id() doesn’t seem work:
postthreadmessage(m_thread->get_id(), wm_quit, 0, 0); e:\documents\khook\khooker\hook_runner.cpp(129): error c2664: 'postthreadmessagew' : cannot convert parameter 1 'std::thread::id' 'dword'
use member function native_handle(). provides native thread handle. can call getthreadid() on it.
Comments
Post a Comment