Win32 实现 MFC CFileDialog 对话框
时间:2014-07-07 08:31:40
收藏:0
阅读:327
void CWriteWnd::OpenFileDialog()
{
OPENFILENAME ofn;
TCHAR szFile[MAX_PATH] = _T("");
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = *this;
ofn.lpstrFile = szFile;
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = NULL;
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
GetOpenFileName(&ofn);
/*if (GetOpenFileName(&ofn))
{
std::vector<wstring> vctString(1, szFile);//保存添加文件的路径
}*/
}
评论(0)