MFC点击按钮显示文件选择器
时间:2020-10-21 22:24:32
收藏:0
阅读:30
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
评论(0)