Win bug: file open truncates default filename

We are seeing a Windows bug with the native file open dialog. Using a JUCE FileChooser class.
You can give the FileChooser a default filename with its “initialFileOrDirectory” parameter. Thats the file name the file chooser suggests the very first. But when that file name is too long, it gets initially shown truncated:

In the above screenshot I was setting “ThisIsAQuiteLongFilenameToTestABug.8proj” as the initial/default file name.
But as you can see, the file name box of the open dialog shows it truncated. Even though there would be space to show more.

I think this is a Windows bug. Because Google tells me, that other have had similar problems. Here is one thread for example:

But the above link also gives a workaround.
Now I was wondering, if the JUCE team wants to implement that workaround in JUCE? :slight_smile:

I was testing using JUCE 6.1.5 on Windows 10 version 21H1.

If you want to get that workaround implemented, you could always do it yourself! The code for opening the native file chooser on Windows is under modules/juce_gui_basics/native/juce_win32_FileChooser.cpp. (Github link)

Also, have you looked into the FileChooserDialogBox?

Well, I try not to patch the JUCE sources themselves.

But I was not aware of FileChooserDialogBox. I’ll give that a try, thanks :slight_smile:

I just tested FileChooserDialogBox. Thanks for suggesting.
But Unfortunately it is not a native dialog. We decided to go with native file browser, therefore it won’t work for us.