SpiecsEngine
 
Loading...
Searching...
No Matches

◆ FileLibrary_SaveInExplore()

std::string Spices::FileLibrary::FileLibrary_SaveInExplore ( const char * filter,
HWND hwnd )
static

Select a file to save in explore.

Parameters
[in]filterThe file extension filter.
[in]hwndThe Windows Needs.
Returns
Returns the file path of selected file.

Definition at line 200 of file FileLibrary.cpp.

201 {
203
204 OPENFILENAMEA ofn; // common dialog box structure
205 CHAR szFile[260] = { 0 }; // if using TCHAR macros
206 // Initialize OPEN FILENAME
207 ZeroMemory(&ofn, sizeof(OPENFILENAMEA));
208 ofn.lStructSize = sizeof(OPENFILENAMEA);
209 ofn.hwndOwner = hwnd;
210 ofn.lpstrFile = szFile;
211 ofn.nMaxFile = sizeof(szFile);
212 ofn.lpstrFilter = filter;
213 ofn.nFilterIndex = 1;
214 ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
215 if (GetSaveFileNameA(&ofn) == TRUE)
216 {
217 return ofn.lpstrFile;
218 }
219 return "";
220 }
#define SPICES_PROFILE_ZONE
typename detail::filter< TypeList, F >::type filter
Keep elements except filtered.
Definition TypeList.h:328