MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / OnFindNext

Method OnFindNext

WinArk/EtwView.cpp:678–747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

676}
677
678LRESULT CEtwView::OnFindNext(WORD, WORD, HWND, BOOL&) {
679 auto& options = CQuickFindDlg::GetSearchOptions();
680 auto& text = CQuickFindDlg::GetSearchText();
681
682 auto step = options.SearchDown ? 1 : -1;
683 auto count = (int)m_Events.size();
684 if (count == 0)
685 return 0;
686
687 auto selected = m_List.GetSelectedIndex() + step;
688 if (selected < 0)
689 selected = count - 1;
690 else if (selected >= count)
691 selected = 0;
692
693 auto start = selected;
694 auto search = text;
695 auto cs = options.CaseSensitive;
696 if (!cs)
697 search.MakeLower();
698
699 // perfrom search
700 bool found = false;
701 do {
702 auto& evt = *m_Events[selected];
703 if (options.SearchProcesses) {
704 CString text = evt.GetProcessName().c_str();
705 if (!cs)
706 text.MakeLower();
707 if (text.Find(search) >= 0) {
708 found = true;
709 break;
710 }
711 }
712 if (options.SearchEvents) {
713 CString text = evt.GetEventName().c_str();
714 if (!cs)
715 text.MakeLower();
716 if (text.Find(search) >= 0) {
717 found = true;
718 break;
719 }
720 }
721 if (options.SearchDetails) {
722 CString text = GetEventDetails(&evt).c_str();
723 if (!cs)
724 text.MakeLower();
725 if (text.Find(search) >= 0) {
726 found = true;
727 break;
728 }
729 }
730
731 // move to the next row
732 selected += step;
733 if (selected >= count)
734 selected = 0;
735 else if (selected < 0)

Callers

nothing calls this directly

Calls 3

FindMethod · 0.80
sizeMethod · 0.45
GetProcessNameMethod · 0.45

Tested by

no test coverage detected