| 683 | } |
| 684 | |
| 685 | INT_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 | |