From b79657aead6fd2e185ca636b62911c7e69d9acdc Mon Sep 17 00:00:00 2001 From: fxliang Date: Fri, 26 Jul 2024 12:45:55 +0800 Subject: [PATCH] fix: unexpected windows error event after closing mmc.exe or WINWORD.EXE --- WeaselIPC/WeaselClientImpl.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/WeaselIPC/WeaselClientImpl.cpp b/WeaselIPC/WeaselClientImpl.cpp index 031bba640..75f727921 100644 --- a/WeaselIPC/WeaselClientImpl.cpp +++ b/WeaselIPC/WeaselClientImpl.cpp @@ -199,19 +199,7 @@ LRESULT ClientImpl::_SendMessage(WEASEL_IPC_COMMAND Msg, PipeMessage req{Msg, wParam, lParam}; LRESULT ret = 0; switch (Msg) { - case WEASEL_IPC_SHUTDOWN_SERVER: - case WEASEL_IPC_START_SESSION: - case WEASEL_IPC_END_SESSION: - case WEASEL_IPC_START_MAINTENANCE: - case WEASEL_IPC_END_MAINTENANCE: - case WEASEL_IPC_UPDATE_INPUT_POS: - case WEASEL_IPC_FOCUS_IN: - case WEASEL_IPC_FOCUS_OUT: - case WEASEL_IPC_TRAY_COMMAND: { - ret = channel.Transact(req); - break; - } - default: { + case WEASEL_IPC_PROCESS_KEY_EVENT: { auto future = std::async(std::launch::async, [this, &req]() { return channel.Transact(req); }); @@ -226,6 +214,10 @@ LRESULT ClientImpl::_SendMessage(WEASEL_IPC_COMMAND Msg, } break; } + default: { + ret = channel.Transact(req); + break; + } } return ret; } catch (DWORD /* ex */) {