Used by: . CPageAdvanced: IDC_CIDERPRESS_BROWSE . CPageSlots: IDC_PRINTER_DUMP_FILENAME_BROWSE
| 146 | // . CPageAdvanced: IDC_CIDERPRESS_BROWSE |
| 147 | // . CPageSlots: IDC_PRINTER_DUMP_FILENAME_BROWSE |
| 148 | std::string CPropertySheetHelper::BrowseToFile(HWND hWindow, const char* pszTitle, const char* REGVALUE, const char* FILEMASKS) |
| 149 | { |
| 150 | char szFilename[MAX_PATH]; |
| 151 | RegLoadString(REG_CONFIG, REGVALUE, 1, szFilename, MAX_PATH, ""); |
| 152 | std::string pathname = szFilename; |
| 153 | |
| 154 | OPENFILENAME ofn; |
| 155 | memset(&ofn, 0, sizeof(OPENFILENAME)); |
| 156 | |
| 157 | ofn.lStructSize = sizeof(OPENFILENAME); |
| 158 | ofn.hwndOwner = hWindow; |
| 159 | ofn.hInstance = GetFrame().g_hInstance; |
| 160 | ofn.lpstrFilter = FILEMASKS; |
| 161 | /*ofn.lpstrFilter = "Applications (*.exe)\0*.exe\0" |
| 162 | "Text files (*.txt)\0*.txt\0" |
| 163 | "All Files\0*.*\0";*/ |
| 164 | ofn.lpstrFile = szFilename; |
| 165 | ofn.nMaxFile = MAX_PATH; |
| 166 | ofn.lpstrInitialDir = ""; |
| 167 | ofn.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY; |
| 168 | ofn.lpstrTitle = pszTitle; |
| 169 | |
| 170 | int nRes = GetOpenFileName(&ofn); |
| 171 | if (nRes) // OK is pressed |
| 172 | pathname = szFilename; |
| 173 | |
| 174 | return pathname; |
| 175 | } |
| 176 | |
| 177 | void CPropertySheetHelper::SaveStateUpdate() |
| 178 | { |
no test coverage detected