首页 > 其他 > 详细

目录选择对话框(实用)

时间:2019-12-31 01:22:20      阅读:112      评论:0      收藏:0      [点我收藏+]

不多说,上代码:

 1 void C目录选择对话框Dlg::OnBnClickedButton1()
 2 {
 3     TCHAR szPath[MAX_PATH] = { 0 };
 4     BROWSEINFO mBroInfo = { 0 };/*Contains parameters for the SHBrowseForFolder function 
 5     and receives information about the folder selected by the user*/
 6     mBroInfo.hwndOwner = m_hWnd;
 7     ITEMIDLIST *pidl = SHBrowseForFolder(&mBroInfo);
 8     if (SHGetPathFromIDList(pidl, szPath)) {  //Converts an item identifier list to a file system path
 9         SetDlgItemText(IDC_EDIT1, szPath);
10     }
11     CoTaskMemFree(pidl);//释放ITEMIDLIST指针
12 }

目录选择对话框(实用)

原文:https://www.cnblogs.com/mktest123/p/12122200.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!