How deep is the Win32 message queue?
-
02-07-2019 - |
Question
How many messages does the queue for a standard window hold? What happens when the queue overflows?
The documentation for GetMessage
and relatives doesn't say anything about this, and PeekMessage
only gives you a yes/no for certain classes of messages, not a message count.
This page says that the queues are implemented using memory-mapped files, and that there is no message count limit, but that page is about WinCE. Does this apply to desktop Win32 as well?
Solution
10000 by default, but it can be adjusted via the registry.
If queue overflows, PostMessage fails.
Documentation here:
OTHER TIPS
As stated in the MSDN article, if you need to worry about the size of the message queue, you might be better off redesigning your application.