title: How can I handle window messages from a separate thread?
body: <p>I wish to launch a separate thread for handling window messages (via a blocking GetMessage loop), but still create the windows in the initial thread, afterward.</p>
  
  <p>Within the separate thread, as soon as it launches, I am calling <code>PeekMessage</code> with PM_NOREMOVE to ensure a message queue exists (is this necessary?), followed by..</p>
  
  <pre><code>AttachThreadInput(initial thread id,GetCurrentThreadId(),true)
  </code></pre>
  
  <p>..before finally entering the message loop</p>
  
  <p>I am not yet using a mutex or cs to ensure this is happening in time, but am merely using a <code>Sleep</code> statement in my initial thread for the sake of simplicity.</p>
  
  <p>Regardless, window messages do not appear to be intercepted by the separate thread.</p>
  
  <p>I am a little unsure as to whether I am doing this correctly, and would appreciate any possible guidance. Both threads are in the same process</p>
  
  <p>Thank you all</p>