From 0b3ed4808b2cbe936bee84c0e615058c53e00ee5 Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Tue, 18 Feb 2020 22:23:22 +0800 Subject: [PATCH] testcancel in PeekMessageEx and WaitMessage --- src/kernel/message.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/kernel/message.c b/src/kernel/message.c index a8dce229..e76de7ae 100644 --- a/src/kernel/message.c +++ b/src/kernel/message.c @@ -201,6 +201,7 @@ void mg_FreeMsgQueueForThisThread (void) } #ifdef _MGHAVE_VIRTUAL_WINDOW +/* no use function */ MSGQUEUE* mg_GetMsgQueueForThisThread (BOOL alloc) { MSGQUEUE* pMsgQueue; @@ -214,6 +215,8 @@ MSGQUEUE* mg_GetMsgQueueForThisThread (BOOL alloc) if (pMsgQueue == NULL && alloc) { pMsgQueue = mg_AllocMsgQueueForThisThread (); + SendMessage (HWND_DESKTOP, MSG_MANAGE_MSGTHREAD, + MSGTHREAD_SIGNIN, (LPARAM)pMsgQueue); } return pMsgQueue; @@ -797,6 +800,8 @@ BOOL PeekMessageEx (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax checkagain: + TEST_CANCEL; + TEST_IF_QUIT(pMsgQueue, hWnd); LOCK_MSGQ (pMsgQueue); @@ -1081,6 +1086,8 @@ BOOL GUIAPI WaitMessage (PMSG pMsg, HWND hWnd) checkagain: + TEST_CANCEL; + TEST_IF_QUIT(pMsgQueue, hWnd); LOCK_MSGQ (pMsgQueue);