title: How to get the winapi id of a thread that has been created using the standard library?
body: <p>C++11’s standard library contains <code>&lt;thread&gt;</code> which allows threads to be created. However, the Windows api requires an ID for some functions (<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms644946%28v=vs.85%29.aspx" rel="noreferrer">PostThreadMessage</a>, namely). How can I get it?</p>
  
  <p>remark: <code>std::thread::get_id()</code> doesn’t seem to work:</p>
  
  <pre><code>PostThreadMessage(m_thread-&gt;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'
  </code></pre>