MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / BrowseToFile

Method BrowseToFile

source/Configuration/PropertySheetHelper.cpp:148–175  ·  view source on GitHub ↗

Used by: . CPageAdvanced: IDC_CIDERPRESS_BROWSE . CPageSlots: IDC_PRINTER_DUMP_FILENAME_BROWSE

Source from the content-addressed store, hash-verified

146// . CPageAdvanced: IDC_CIDERPRESS_BROWSE
147// . CPageSlots: IDC_PRINTER_DUMP_FILENAME_BROWSE
148std::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
177void CPropertySheetHelper::SaveStateUpdate()
178{

Callers 2

DlgProcInternalMethod · 0.80

Calls 1

RegLoadStringFunction · 0.85

Tested by

no test coverage detected