1 void CFileFinderDlg::OnButton1() 2 { 3 // TODO: Add your control notification handler code here 4 5 TCHAR szPath[MAX_PATH]={0}; 6 BROWSEINFO mBroInfo={0}; 7 mBroInfo.hwndOwner = m_hWnd; 8 ITEMIDLIST *pidl = SHBrowseForFolder(&mBroInfo); 9 if(SHGetPathFromIDList(pidl,szPath)) 10 { 11 SetDlgItemText(IDC_EDIT1,szPath); 12 } 13 CoTaskMemFree(pidl); 14 }
原文:https://www.cnblogs.com/2020323LJM/p/13854849.html