| 1011 | } |
| 1012 | |
| 1013 | bool ProcessMessage(MSG& Msg) |
| 1014 | { |
| 1015 | bool bRc = true; |
| 1016 | static bool bQuitMsg = false; |
| 1017 | static MSG MouseClickPatch = {}; |
| 1018 | |
| 1019 | #ifdef _DEBUG |
| 1020 | static DWORD LastInsideCheck = 0; |
| 1021 | const DWORD DeltaInsideCheck = 1000; |
| 1022 | #endif |
| 1023 | |
| 1024 | MSetter nestedLevel(&gnMessageNestingLevel); |
| 1025 | |
| 1026 | gnLastMsgTick = GetTickCount(); |
| 1027 | |
| 1028 | if (Msg.message == WM_QUIT) |
| 1029 | { |
| 1030 | bQuitMsg = true; |
| 1031 | bRc = false; |
| 1032 | goto wrap; |
| 1033 | } |
| 1034 | |
| 1035 | // Do minimal in-memory logging (small circular buffer) |
| 1036 | ConEmuMsgLogger::Log(Msg, ConEmuMsgLogger::msgCommon); |
| 1037 | |
| 1038 | if (gpConEmu) |
| 1039 | { |
| 1040 | #ifdef _DEBUG |
| 1041 | if (gpConEmu->mp_Inside) |
| 1042 | { |
| 1043 | DWORD nCurTick = GetTickCount(); |
| 1044 | if (!LastInsideCheck) |
| 1045 | { |
| 1046 | LastInsideCheck = nCurTick; |
| 1047 | } |
| 1048 | else if ((LastInsideCheck - nCurTick) >= DeltaInsideCheck) |
| 1049 | { |
| 1050 | if (gpConEmu->isInsideInvalid()) |
| 1051 | { |
| 1052 | // Show assertion once |
| 1053 | static bool bWarned = false; |
| 1054 | if (!bWarned) |
| 1055 | { |
| 1056 | bWarned = true; |
| 1057 | _ASSERTE(FALSE && "Parent was terminated, but ConEmu wasn't"); |
| 1058 | } |
| 1059 | } |
| 1060 | LastInsideCheck = nCurTick; |
| 1061 | } |
| 1062 | } |
| 1063 | #endif |
| 1064 | |
| 1065 | if (gpConEmu->isDialogMessage(Msg)) |
| 1066 | goto wrap; |
| 1067 | |
| 1068 | switch (Msg.message) |
| 1069 | { |
| 1070 | case WM_SYSCOMMAND: |
no test coverage detected