| 1123 | } |
| 1124 | |
| 1125 | void CMainFrame::Resume() |
| 1126 | { |
| 1127 | SetTitle(); |
| 1128 | |
| 1129 | if (!m_pLocalReader) |
| 1130 | { |
| 1131 | try |
| 1132 | { |
| 1133 | m_pLocalReader = m_logSources.AddDBWinReader(false); |
| 1134 | } |
| 1135 | catch (std::exception&) |
| 1136 | { |
| 1137 | MessageBox( |
| 1138 | L"Unable to capture Win32 Messages.\n" |
| 1139 | L"\n" |
| 1140 | L"Another DebugView++ (or similar application) might be running.\n", |
| 1141 | m_applicationName.c_str(), MB_ICONERROR | MB_OK); |
| 1142 | return; |
| 1143 | } |
| 1144 | } |
| 1145 | |
| 1146 | if (m_tryGlobal) |
| 1147 | { |
| 1148 | try |
| 1149 | { |
| 1150 | m_pGlobalReader = m_logSources.AddDBWinReader(true); |
| 1151 | } |
| 1152 | catch (std::exception&) |
| 1153 | { |
| 1154 | MessageBox( |
| 1155 | L"Unable to capture Global Win32 Messages.\n" |
| 1156 | L"\n" |
| 1157 | L"Make sure you have appropriate permissions.\n" |
| 1158 | L"\n" |
| 1159 | L"You may need to start this application by right-clicking it and selecting\n" |
| 1160 | L"'Run As Administator' even if you have administrator rights.", |
| 1161 | m_applicationName.c_str(), MB_ICONERROR | MB_OK); |
| 1162 | m_tryGlobal = false; |
| 1163 | } |
| 1164 | } |
| 1165 | |
| 1166 | std::wstring title = L"Paused"; |
| 1167 | if (m_pLocalReader && m_pGlobalReader) |
| 1168 | { |
| 1169 | title = L"Capture Win32 & Global Win32 Messages"; |
| 1170 | } |
| 1171 | else if (m_pLocalReader) |
| 1172 | { |
| 1173 | title = L"Capture Win32"; |
| 1174 | } |
| 1175 | else if (m_pGlobalReader) |
| 1176 | { |
| 1177 | title = L"Capture Global Win32"; |
| 1178 | } |
| 1179 | SetTitle(title); |
| 1180 | } |
| 1181 | |
| 1182 | void CMainFrame::OnLogPause(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl*/) |
nothing calls this directly
no test coverage detected