标签:style ar sp for on 文件 log bs amp
OPENFILENAME ofn; // common dialog box structure
TCHAR szFile[MAX_PATH]; // buffer for file name
// Initialize OPENFILENAME
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwndDlg;
ofn.lpstrFile = szFile;
ofn.lpstrFile[0] = ‘\0‘; //
// Set lpstrFile[0] to ‘\0‘ so that GetOpenFileName does not
// use the contents of szFile to initialize itself.
//
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = _T("Text files (*.txt)\0*.txt\0\0");
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
ofn.lpstrTitle = _T("打开"); // set the dialog box title
if (GetOpenFileName(&ofn))
{
SetDlgItemText(hwndDlg, IDC_EDIT1, szFile);
}
标签:style ar sp for on 文件 log bs amp
原文地址:http://www.cnblogs.com/huhu0013/p/4171373.html