| 576 | } |
| 577 | |
| 578 | LRESULT CMainFrame::OnMonitorStart(WORD, WORD, HWND, BOOL&) { |
| 579 | m_pEtwView->StartMonitoring(m_tm, true); |
| 580 | bool isWin8Plus = ::IsWindows8OrGreater(); |
| 581 | if (isWin8Plus) { |
| 582 | m_tm.Start([&](auto data) { |
| 583 | m_pEtwView->AddEvent(data); |
| 584 | }); |
| 585 | } |
| 586 | else { |
| 587 | DWORD flags = 0; |
| 588 | for (auto type : m_tm.GetKernelEventTypes()) { |
| 589 | flags |= (DWORD)type; |
| 590 | } |
| 591 | if (flags == 0) |
| 592 | flags = (DWORD)KernelEventTypes::Process; |
| 593 | m_tm.Start([&](auto data) { |
| 594 | m_pEtwView->AddEvent(data); |
| 595 | }, flags); |
| 596 | } |
| 597 | |
| 598 | ClearToolBarButtons(m_tb); |
| 599 | InitEtwToolBar(m_tb); |
| 600 | |
| 601 | SetTimer(1, 5000, nullptr); |
| 602 | SetPaneIcon(1, m_RunIcon); |
| 603 | return 0; |
| 604 | } |
| 605 | |
| 606 | LRESULT CMainFrame::OnMonitorStop(WORD, WORD, HWND, BOOL&) { |
| 607 | KillTimer(1); |
nothing calls this directly
no test coverage detected