-1

In the documentation for Microsoft, it states PeekMessageW dispatch the message if any.

But why in this case is there the need of a DispatchMessageW function ? The few example I could gather use both together, calling DispatchMessage after PeekMessage/GetMessage.

I also can observe experimentally that peekMessage does not dispatch the message but seems to only give a look at the message queue.

sandwood
  • 2,038
  • 20
  • 38

1 Answers1

0

The behavior of PeekMessageW is documented:

During this call, the system delivers pending, nonqueued messages, that is, messages sent to windows owned by the calling thread using the SendMessage, SendMessageCallback, SendMessageTimeout, or SendNotifyMessage function. Then the first queued message that matches the specified filter is retrieved.

Messages and Message Queues explains the terminology as well as the underlying principles.

IInspectable
  • 46,945
  • 8
  • 85
  • 181