-
-
Save ZweiSteinSoft/b2c9f12311287feb0a0c to your computer and use it in GitHub Desktop.
Pointer to ExtensionString
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int32 ShowSaveDialog(ExtensionString title, | |
ExtensionString initialDirectory, | |
ExtensionString fileTypes, | |
CefRefPtr<ExtensionString>& selectedFile) | |
{ | |
wchar_t szFile[MAX_PATH]; | |
szFile[0] = 0; | |
// ofn.lpstrInitialDir needs Windows path on XP and not Unix path. | |
ConvertToNativePath(initialDirectory); | |
OPENFILENAME ofn; | |
ZeroMemory(&ofn, sizeof(ofn)); | |
ofn.hwndOwner = GetActiveWindow(); | |
ofn.lStructSize = sizeof(ofn); | |
ofn.lpstrFile = szFile; | |
ofn.nMaxFile = MAX_PATH; | |
// TODO (issue #65) - Use passed in file types. Note, when fileTypesStr is null, all files should be shown | |
/* findAndReplaceString( fileTypesStr, std::string(" "), std::string(";*.")); | |
LPCWSTR allFilesFilter = L"All Files\0*.*\0\0";*/ | |
ofn.lpstrFilter = L"All Files\0*.*\0Web Files\0*.js;*.css;*.htm;*.html\0\0"; | |
ofn.lpstrInitialDir = initialDirectory.c_str(); | |
ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR | OFN_EXPLORER; | |
selectedFile = L""; // "=" has red underline wave | |
if (GetSaveFileName(&ofn)) { | |
selectedFile = szFile; | |
} | |
return NO_ERROR; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment