Win7, message queue size = 10000, post a message to a full queue will result GetLastError() = 1816 (Not enough quota is available to process this command.)
// srouce code
BEGIN_MESSAGE_MAP(Cmfc1Dlg, CDialogEx)
ON_MESSAGE(WM_MY_MSG, &Cmfc1Dlg::OnMyMsg)
END_MESSAGE_MAP()
LRESULT Cmfc1Dlg::OnMyMsg(WPARAM wParam, LPARAM lParam)
{
TRACE("get msg %d/n", (int)wParam);
//block all the upcomming messages in the message queue
while(1);
return 0;
}
void Cmfc1Dlg::OnBnClickedButton1()
{
for(int i = 1; i <= 100000; i++)
{
if(!PostMessage(WM_MY_MSG, (WPARAM)i, 0))
{
TRACE("post fail i = %d, last error = %d/n", i, GetLastError());
break;
}
}
}
figure out windows message queue size
最新推荐文章于 2024-08-31 10:00:00 发布