title: Is there a function like PeekMessage that doesn't process messages?
body: <p>I'm trying to innocently call</p>
  
  <pre><code>PeekMessage(&amp;msg, 0, WM_KEYDOWN, WM_KEYUP, PM_NOREMOVE | PM_NOYIELD);
  </code></pre>
  
  <p>and Windows Vista 64, in the PeekMessage call, is <strong>processing messages</strong>.  The result is that I'm going re-entrant on my paint call, and all sorts of other code.</p>
  
  <p>Painting can take seconds in our application, so we added the PeekMessage call to see if the user hit a key, so we could interrupt that painting and start up the next one.  Little did we realize that Windows could start processing messages on us.  It'd be a major refactoring to put the real work of painting in a separate thread...  We're trying to see if specific keys were pressed, or if the mouse wheel rotated or mouse buttons were clicked, to interrupt rendering.</p>
  
  <p>I've tried adding code specifically to prevent re-entrancy, and then re-injecting paint messages into the queue, etc.  It's all very kludgey, and there are cases where it doesn't work well.</p>
  
  <p>Is there some flag I could add to the PeekMessage call?  I didn't see anything new in the documentation on MSDN.  I really need a <code>PeekMessage</code> that doesn't process messages.  Help!</p>