CFileDialog Filedlg(TRUE,
NULL,
NULL,
OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT |
OFN_ALLOWMULTISELECT|OFN_EXPLORER,
"Data Files (*.bak;*.txt)|*.bak;*.txt|All files(*.*)|*.*||",
NULL);
Filedlg.m_ofn.lpstrFile = lpstrFilename;
Filedlg.m_ofn.lpstrTitle = "新标题";//改变标题
Filedlg.m_ofn.lpstrInitialDir = "c:\\data";//设定打开初始目录
Filedlg.m_ofn.lStructSize = structsize;
Filedlg.m_ofn.nMaxFile = MAX_PATH;
if(Filedlg.DoModal() == IDOK)
{
CString strFilePath = Filedlg.GetPathName();
}
No comments:
Post a Comment