title: Is the Windows message queue handle the message in an FIFO way?
body: <p>I assume when we call <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms644950(v=vs.85).aspx" rel="nofollow"><code>SendMessage</code></a> &amp; <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms644944(v=vs.85).aspx" rel="nofollow"><code>PostMessage</code></a>, the message will be handled in the same order as the <code>Send/PostMessage</code> called. But as the <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms644950(v=vs.85).aspx" rel="nofollow">document</a> says the <code>SendMessage</code> will execute the function if the current thread is the correct one.</p>
  
  <blockquote>
    <p>If the specified window was created by the calling thread, the window
    procedure is called immediately as a subroutine.</p>
  </blockquote>
  
  <p>So in following case:</p>
  
  <pre><code>PostMessage(currentThreadWindow, postMsg, ...) // line 1
  SendMessage(currentThreadWindow, sendMsg...) // line 2
  </code></pre>
  
  <p>the <code>sendMsg</code> will be handled before <code>postMsg</code>.</p>
  
  <p>So does message passed to <code>SendMessage</code> and <code>PostMessage</code> keep the order?</p>