MFC shelltree获取选项路径

ON_NOTIFY(TVN_SELCHANGING, IDC_MFCSHELLTREE1, &CSearchExploreDlg::OnClickMfcshelltree1)

void CSearchExploreDlg::OnClickMfcshelltree1(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: ここにコントロール通知ハンドラー コードを追加します。

//UpdateData(FALSE);

CString strPath;
LPNMTREEVIEW pNMTreeView = reinterpret_cast(pNMHDR);
HTREEITEM hitem = pNMTreeView->itemNew.hItem;
m_wbdShellTree.GetItemPath(strPath, hitem);

CString szSel = pNMTreeView->itemNew.pszText;
CString szSel2 = pNMTreeView->itemOld.pszText;
SetDlgItemText(IDC_EDIT1, strPath);
*pResult = 0;

}

你可能感兴趣的:(MFC自学)