title: Suspend and resume the main thread in C++ for Windows
body: <p>I need to be able to suspend and resume the main thread in a Windows C++ app. I have used</p>
  
  <pre><code>handle = GetCurrentThread();
  SuspendThread(handle);
  </code></pre>
  
  <p>and then where is should be resumed</p>
  
  <pre><code>ResumeThread(handle);
  </code></pre>
  
  <p>while suspending it works, resuming it does not. I have other threads that are suspended and resumed with no problems, is there something that is different with the main thread.</p>
  
  <p>I have done a lot of threading working in C# and Java but this is the first time I have done any in C++ and I'm finding it to be quite a bit different.</p>