如何让通用对话框支持多选:
1 void C通用对话框Dlg::OnBnClickedButton1() 2 { 3 CFileDialog fileDlg(TRUE,NULL,NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_ALLOWMULTISELECT,_T("Text Files(*.txt)|*.txt|Execute Files(*.exe)|*.exe|WinRAR Files(*.rar)|*rar|ALL Files(*.*)|*.*||")); 4 if (fileDlg.DoModal() == IDOK) 5 { 6 POSITION pos = fileDlg.GetStartPosition(); 7 while (pos) { 8 CString str = fileDlg.GetNextPathName(pos); 9 MessageBox(str); 10 } 11 //SetDlgItemText(IDC_EDIT1, fileDlg.GetPathName()); 12 } 13 }
原文地址:https://www.cnblogs.com/mktest123/p/12122021.html
时间: 2024-11-08 21:29:33