MCPcopy Create free account
hub / github.com/derceg/explorerplusplus / OnNotify

Method OnNotify

Explorer++/Explorer++/SearchDialog.cpp:685–815  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

683}
684
685INT_PTR SearchDialog::OnNotify(NMHDR *pnmhdr)
686{
687 switch (pnmhdr->code)
688 {
689 case NM_DBLCLK:
690 if (pnmhdr->hwndFrom == GetDlgItem(m_hDlg, IDC_LISTVIEW_SEARCHRESULTS))
691 {
692 HWND hListView = GetDlgItem(m_hDlg, IDC_LISTVIEW_SEARCHRESULTS);
693 int iSelected = ListView_GetNextItem(hListView, -1, LVNI_ALL | LVNI_SELECTED);
694
695 if (iSelected != -1)
696 {
697 LVITEM lvItem;
698
699 lvItem.mask = LVIF_PARAM;
700 lvItem.iItem = iSelected;
701 lvItem.iSubItem = 0;
702
703 BOOL bRet = ListView_GetItem(hListView, &lvItem);
704
705 if (bRet)
706 {
707 auto itr = m_SearchItemsMapInternal.find(static_cast<int>(lvItem.lParam));
708
709 /* Item should always exist. */
710 assert(itr != m_SearchItemsMapInternal.end());
711
712 unique_pidl_absolute pidlFull;
713 HRESULT hr = SHParseDisplayName(
714 itr->second.c_str(), nullptr, wil::out_param(pidlFull), 0, nullptr);
715
716 if (hr == S_OK)
717 {
718 m_pexpp->OpenItem(pidlFull.get(), FALSE, FALSE);
719 }
720 }
721 }
722 }
723 break;
724
725 case NM_CLICK:
726 {
727 if (pnmhdr->hwndFrom == GetDlgItem(m_hDlg, IDC_LINK_STATUS))
728 {
729 auto pnmlink = reinterpret_cast<PNMLINK>(pnmhdr);
730
731 ShellExecute(nullptr, L"open", pnmlink->item.szUrl, nullptr, nullptr, SW_SHOW);
732 }
733 }
734 break;
735
736 case NM_RCLICK:
737 {
738 if (pnmhdr->hwndFrom == GetDlgItem(m_hDlg, IDC_LISTVIEW_SEARCHRESULTS))
739 {
740 HWND hListView = GetDlgItem(m_hDlg, IDC_LISTVIEW_SEARCHRESULTS);
741 int iSelected = ListView_GetNextItem(hListView, -1, LVNI_ALL | LVNI_SELECTED);
742

Callers

nothing calls this directly

Calls 8

IsKeyDownFunction · 0.85
c_strMethod · 0.80
GetStatusBarMethod · 0.80
findMethod · 0.45
endMethod · 0.45
OpenItemMethod · 0.45
getMethod · 0.45
ShowMenuMethod · 0.45

Tested by

no test coverage detected