Is there any way to programmatically check the priority of a window messages in its message queue?
For example: Some of window messages, WM_PAINT
and WM_TIMER
are known have the lowest priority and be placed after messages with highest priority.
I'm looking for something by which you can confirm that which one of two messages will have the lowest or highest priority or which message will be sent first or last?
A category of precedence reserved for messages that require expeditious action by the addressee(s) and/or furnish essential information for the conduct of operations in progress when routine precedence will not suffice. See also precedence. Dictionary of Military and Associated Terms.
The operating system communicates with your application window by passing messages to it. A message is simply a numeric code that designates a particular event. For example, if the user presses the left mouse button, the window receives a message that has the following message code.
Most other messages, which are sent directly to a window procedure, are called nonqueued messages.
Message queues is used to route mouse and keyboard input to the appropriate window. Nonqueued messages are sent immediately to the destination window procedure, bypassing the system message queue and thread message queue.
That's just not how it works, Windows messages don't have a priority attached. It is mostly determined by how the message is generated. A message loop dispatches messages in this order:
The 'synthesized from the window state' clause is what makes WM_PAINT and WM_TIMER appear to have a low priority. And why moving the mouse rapidly doesn't flood the message queue with mouse messages. That is however not exclusive, you can for example call UpdateWindow() to force a WM_PAINT message to be sent, making it being dispatched with a 'high priority'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With