JUCE’s behaviour is really weird indeed. For instance I want to save a called XXX with default extension .YYY, I type no extension in my save dialog (so the default .YYY should be added automatically), and if there’s a file XXX (without any extension) on the disk, then I’m asked by Windows if I want to overwrite this file, which doesn’t make any sense at all, because I don’t want to overwrite XXX, but I want to overwrite XXX.YYY!
I think this is a JUCE bug. In fact, the extension is not added to the file.
Why? Because lpstrDefExt is not set by JUCE.
lpstrDefExt
Pointer to a buffer that contains the default extension. GetOpenFileName and GetSaveFileName append this extension to the file name if the user fails to type an extension. This string can be any length, but only the first three characters are appended. The string should not contain a period (.). If this member is NULL and the user fails to type an extension, no extension is appended.
I agree that as of now the feature is not very useful, I also had to disable the overwrite check of the filechooser, manually add the extension after calling browseForFileToSave, and then check if the file already exists.
Not a big deal, but the warnAboutOverwriting is confusing.