Reputation: 1
I'm a bit confused by the msdn GetMessage explanation.
They state that BOOL GetMessage() can return 0 when the method retrieves WM_QUIT. It returns -1 when there is an error and it returns positive for any other message.
But how can this be. A Boolean should be false or true, 0 or 1. How can it return a -1.
Link to msdn GetMessage: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmessage
Upvotes: 0
Views: 362
Reputation: 352
The Windows Type BOOL is just a typedef of an integer. You must not confuse this with the cpp bool because it can only be true and false
Upvotes: 1
Reputation: 409166
In the Windows world, BOOL
is a type-alias for int
(according to the official documentation). Therefore it can have any value that an int
could have.
Upvotes: 0