return TRUE;
}
- /* Now look for a quit message. */
- if (pti->QuitPosted)
+ /* Only check for quit messages if not posted messages pending. */
+ if (ProcessMask & QS_POSTMESSAGE && pti->QuitPosted)
{
/* According to the PSDK, WM_QUIT messages are always returned, regardless
of the filter specified */
Message.lParam = lParam;
}
- if (WM_QUIT == Msg)
- {
- MsqPostQuitMessage(pti, wParam);
- }
- else
- {
- MsqPostMessage(pti, &Message, FALSE, QS_POSTMESSAGE, 0, ExtraInfo);
- }
+ MsqPostMessage(pti, &Message, FALSE, QS_POSTMESSAGE, 0, ExtraInfo);
}
return TRUE;
}
ListEntry);
if (PostedMessage->Msg.hwnd == Window->head.h)
{
+ if (PostedMessage->Msg.message == WM_QUIT && pti->QuitPosted == 0)
+ {
+ pti->QuitPosted = 1;
+ pti->exitCode = PostedMessage->Msg.wParam;
+ }
RemoveEntryList(&PostedMessage->ListEntry);
ClearMsgBitsMask(pti, PostedMessage->QS_Flags);
MsqDestroyMessage(PostedMessage);