Skip to main content
gamedev.net
🔒 Locked

PeekMessage

Started by GravtyKlz Feb 25, 2003 at 10:05 PM 2 replies 650+ views
Original Post
GravtyKlz
GravtyKlz
What advantages/disadvantages are there to using PeekMessage over GetMessage for a windows API. I understand that the loops are some how different but I dont really understand how, or what benefit it has. Thanks
Enfekted
Enfekted
I''m not 100% sure, but i think GetMessage() will wait until there is a message and PeekMessage() will go on whether there''s a message to process or not.
microdot
microdot
Here's what I remember off the top of my head...

PeekMessage () :
* Returns non-zero if there is a message in the queue, 0 if there is not.
* Always returns immediately.
* You have the option of removing said message or leaving it in the queue.
GetMessage ()
* Returns 0 if the message in the queue is WM_QUIT, -1 if there is an error, non-zero otherwise.
* Doesn't return until there is a message on the queue.
* Removes the message from the queue.

try this for more info.




[edited by - microdot on February 25, 2003 11:29:02 PM]
<span class="smallfont">That is not dead which can eternal lieAnd with strange aeons even death may die.   -- "The Nameless City" - H. P. Lovecraft</span>
doctorsixstring
doctorsixstring
quote:
Original post by Enfekted
GetMessage() will wait until there is a message and PeekMessage() will go on whether there''s a message to process or not.


That is correct. You can now be 100% sure .

-Mike

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.