MFC提供CFileDialog來幫你完成
Here is the sample
CString OpenFileDialog()
{
CString strReturn = L"";
CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY);
if(dlg.DoModal()==IDOK)
{
strReturn = dlg.GetPathName();
}
else
{
//user cancel
}
Sleep(1000);
return strReturn;
}
So, you can choose a file like this
沒有留言:
張貼留言