What does Application->ProcessMessage do?
<p>I'm converting a C++ application to C# and I've come across this single line of code in numerous places in the codebase:</p>

<pre><code>Application-&gt;ProcessMessages()
</code></pre>

<p>I found this link: <a href="http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/Forms_TApplication_ProcessMessages.html" rel="nofollow">http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/Forms_TApplication_ProcessMessages.html</a></p>

<p>Which says <code>ProcessMessages()</code> does the following: </p>

<blockquote>
  <p>Call ProcessMessages to permit the application to process messages that are currently in the message queue. ProcessMessages cycles the Windows message loop until it is empty, and then returns control to the application.</p>
</blockquote>

<p>But what is a "message" and what is the "message queue"? How do messages get added? What sort of processing is done?</p>

<p>I can't seem to find any concrete explanations as to what this does, which is important because I don't know what would be the C# / .NET equivalent of this method call, or is it its functionality in some shape or way just baked into .NET and I don't need to do anything?</p>

<p>Tagged question with C# since I'm most curious about its .NET equivalent, but the real intent of the thread is simply to understand what this does as far as C++ is concerned.</p>