MFC点击按钮显示文件选择器
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 }

浙公网安备 33010602011771号