| 167 | } |
| 168 | |
| 169 | LRESULT CMainFrame::OnCreate(const CREATESTRUCT* /*pCreate*/) |
| 170 | { |
| 171 | m_notifyIconData.cbSize = 0; |
| 172 | |
| 173 | HWND hWndCmdBar = m_cmdBar.Create(*this, rcDefault, nullptr, ATL_SIMPLE_CMDBAR_PANE_STYLE); |
| 174 | m_cmdBar.AttachMenu(GetMenu()); |
| 175 | m_cmdBar.LoadImages(IDR_MAINFRAME); |
| 176 | SetMenu(nullptr); |
| 177 | |
| 178 | CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE); |
| 179 | CReBarCtrl rebar(m_hWndToolBar); |
| 180 | |
| 181 | AddSimpleReBarBand(hWndCmdBar); |
| 182 | |
| 183 | HWND hWndToolBar = CreateSimpleToolBarCtrl(rebar, IDR_MAINFRAME, false, ATL_SIMPLE_TOOLBAR_PANE_STYLE); // DrMemory: LEAK 1696 direct bytes |
| 184 | AddSimpleReBarBand(hWndToolBar, nullptr, true); |
| 185 | UIAddToolBar(hWndToolBar); |
| 186 | |
| 187 | m_findDlg.Create(rebar); |
| 188 | AddSimpleReBarBand(m_findDlg, L"Find: ", false, 10000); |
| 189 | SizeSimpleReBarBands(); |
| 190 | |
| 191 | rebar.LockBands(true); |
| 192 | rebar.SetNotifyWnd(*this); |
| 193 | |
| 194 | m_hWndStatusBar = m_statusBar.Create(*this); |
| 195 | int paneIds[] = { ID_DEFAULT_PANE, ID_SELECTION_PANE, ID_VIEW_PANE, ID_LOGFILE_PANE, ID_MEMORY_PANE }; |
| 196 | m_statusBar.SetPanes(paneIds, 5, false); |
| 197 | UIAddStatusBar(m_hWndStatusBar); |
| 198 | |
| 199 | CreateTabWindow(*this, rcDefault, CTCS_CLOSEBUTTON | CTCS_DRAGREARRANGE); |
| 200 | |
| 201 | AddFilterView(L"View"); |
| 202 | HideTabControl(); |
| 203 | |
| 204 | SetLogFont(); |
| 205 | LoadSettings(); |
| 206 | |
| 207 | // register object for message filtering and idle updates |
| 208 | CMessageLoop* pLoop = _Module.GetMessageLoop(); |
| 209 | ATLASSERT(pLoop != nullptr); |
| 210 | pLoop->AddMessageFilter(this); |
| 211 | pLoop->AddIdleHandler(this); |
| 212 | |
| 213 | m_logSources.SubscribeToUpdate([this] { return OnUpdate(); }); |
| 214 | DragAcceptFiles(true); |
| 215 | |
| 216 | // Resume can throw if a second debugview is running |
| 217 | // so do not rely on any commands executed afterwards |
| 218 | if (!IsDBWinViewerActive()) |
| 219 | Resume(); |
| 220 | return 0; |
| 221 | } |
| 222 | |
| 223 | void CMainFrame::OnClose() |
| 224 | { |
nothing calls this directly
no test coverage detected