| 573 | } |
| 574 | |
| 575 | LRESULT CEtwView::OnSave(WORD, WORD, HWND, BOOL&) { |
| 576 | CSimpleFileDialog dlg(FALSE, L"pmx", nullptr, OFN_EXPLORER | OFN_OVERWRITEPROMPT | OFN_ENABLESIZING, |
| 577 | L"ProcMonX files (*.pmx)\0*.pmx\0CSV Files (*csv)\0*.csv\0", *this); |
| 578 | if (dlg.DoModal() == IDOK) { |
| 579 | CString filename(dlg.m_szFileTitle); |
| 580 | auto ext = filename.ReverseFind(L'.'); |
| 581 | if (ext > 0) { |
| 582 | auto serializer = SerializerFactory::CreateFromExtension(filename.Mid(ext + 1)); |
| 583 | if (serializer) { |
| 584 | EventDataSerializerOptions options; |
| 585 | CWaitCursor wait; |
| 586 | auto eventsCopy = m_OrgEvents; |
| 587 | if (!serializer->Save(eventsCopy, options, dlg.m_szFileName)) |
| 588 | AtlMessageBox(*this, L"Failed to save data", IDS_TITLE, MB_ICONERROR); |
| 589 | return 0; |
| 590 | } |
| 591 | } |
| 592 | AtlMessageBox(*this, L"Unknown file extension", IDS_TITLE, MB_ICONEXCLAMATION); |
| 593 | } |
| 594 | return 0; |
| 595 | } |
| 596 | |
| 597 | LRESULT CEtwView::OnCopyAll(WORD, WORD, HWND, BOOL&) { |
| 598 | ATLASSERT(!m_IsMonitoring || GetFrame()->GetTraceManager().IsPaused()); |