Ken Litwak
Ken,
They are used differently. GetMessage only returns when there is a
message in your applications message queue. PeekMessage will also
return when your mesage queue is empty - so letting you perform other
tasks in your message loop (idle time processing).
Dave
----
Address is altered to discourage junk mail.
Remove ".---" for the real address.
Understood, Dave, but the question I really want to resolve is
whether it's actually faster or somehow better, if you don't need to do
anything until the next message, to use PeekMessage instead of
GetMessage. I haven't seen any samples that use PeekMessage in the main
message loop nor do any of the authors I have, like Petzold or Richter,
say PeekMessage is better. That's the point. Thanks.
Ken
Ken,
If you application doesn't need to use PeekMessage to do idle
processing, then GetMessage will be more efficient on the system as it
never returns to your application to waste time in your message loop
when there aren't any messages pending in your message queue.
Seems a reasonable argument to me.