fix #3010: extension not added on native save file dialog

This commit is contained in:
IntelOrca 2016-03-01 21:46:00 +00:00
parent 669c15cbaf
commit c8015cab92
1 changed files with 4 additions and 0 deletions

View File

@ -635,6 +635,10 @@ int platform_open_common_file_dialog(filedialog_type type, utf8 *title, utf8 *fi
// Open dialog
commonFlags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR;
if (type == FD_SAVE) {
wchar_t *defaultExtension = wcsrchr(wcfilterPattern, '.');
if (defaultExtension != NULL) {
openFileName.lpstrDefExt = defaultExtension + 1;
}
openFileName.Flags = commonFlags | OFN_CREATEPROMPT | OFN_OVERWRITEPROMPT;
result = GetSaveFileNameW(&openFileName);
} else if (type == FD_OPEN) {