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
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'.
The order is defined in GetMessage / PeekMessage documentation:
If no filter is specified, messages are processed in the following order:
- Sent messages
- Posted messages
- Input (hardware) messages and system internal events
- Sent messages (again)
- WM_PAINT messages
- WM_TIMER messages