The GetMessage API is an interesting example of the bizarre
Microsoft Troolean (as opposed to traditional, Boolean) logic. GetMessage is defined to return a
BOOL, but the documentation specifies three types of returns, non-zero, zero and -1. I am not making it up! Here's an excerpt from the
help file:
* If the function retrieves a message other than
WM_QUIT, the return value is nonzero.
* If the function retrieves the WM_QUIT message, the return value is zero.
* If there is an error, the return value is -1.
Excerpt from Reliable Software, LLC