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?

Was it helpful?

Solution

10000 by default, but it can be adjusted via the registry.

If queue overflows, PostMessage fails.

Documentation here:

PostMessage function on MSDN

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top