Date: Thu, 13 Jul 2000 10:56:25 -0400
From: Richard Kelsey
To: Jonathan Rees
Subject: MS Windows documentation

The documentation for window-message loops begins:

  A simple message loop consists of one function call to each of these
  three functions: GetMessage, TranslateMessage, and DispatchMessage.

  MSG msg;

  while( GetMessage( &msg, NULL, 0, 0 ) )
  {
      TranslateMessage( &msg );
      DispatchMessage( &msg );
  }
 
The documentation for the GetMessage procedure concludes with:

  Note that the function return value can be nonzero, zero, or -1.
  Thus, you should avoid code like this:

  while (GetMessage( lpMsg, hWnd, 0, 0)) ... 
 
  The possibility of a -1 return value means that such code can lead
  to fatal application errors.