title: why exactly TranslateMessage
body: <p>I am trying to make sense of 'The Message Loop'.
  This is how it looks:</p>
  
  <pre><code>MSG msg = { };
  while (GetMessage(&amp;msg, NULL, 0, 0))
  {
      TranslateMessage(&amp;msg);
      DispatchMessage(&amp;msg);
  }
  </code></pre>
  
  <p>So far I am clear(at least I hope so) with the concept.When the user interacts with windows application using keyboard and mouse,those events are converted to appropriate messages by the respective device drivers and posted to system message queue.</p>
  
  <p>The OS removes messages from the queue one by one and examines each of them to send them to respective application's thread's queue that is responsible for having created the destination window.</p>
  
  <p>Now in my application </p>
  
  <pre><code>MSG msg;
  GetMessage(&amp;msg, NULL, 0, 0);
  </code></pre>
  
  <p>removes the message from thread specific message queue and fills the MSG structure.</p>
  
  <p>But <code>TranslateMessage</code> is said to translate the virtual keystrokes to characters and post them back to the caller thread's message queue.</p>
  
  <p><code>DispatchMessage</code> directs the OS to call the Windows Procedure of appropriate target window.</p>
  
  <p>Two doubts:</p>
  
  <p>1)What is the exact functionality of TranslateMessage;is it just to translate virtual keystrokes to character messages(I assume virtual keystrokes to be keystrokes other than alphabets and numbers),if character message is posted back to queue,isn't the loop broken?</p>
  
  <p>2)What about the mouse events?are they directly dispatched?</p>