How deep is the Win32 message queue?

落爺英雄遲暮 提交于 2019-11-27 03:55:27

问题


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?


回答1:


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

If queue overflows, PostMessage fails.

Documentation here:

PostMessage function on MSDN




回答2:


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.



来源:https://stackoverflow.com/questions/123323/how-deep-is-the-win32-message-queue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!