FileBrowser MultiDir on Win?


I want my users to select multiple directories, using a native file browser. For that I am using the JUCE FileBrowser class.
But I can’t get it to work on Windows (on Mac its fine). The problem is: even though I am setting the “canSelectMultipleItems” flag, I can only select one directory, and not multiple directories.

Here is my code:

FileChooser dirChooser("Select directories...",
	String() /* allow any file pattern */,
	true /* tell to use native file browser */);

dirChooser.showDialog(FileBrowserComponent::openMode |
                      FileBrowserComponent::canSelectMultipleItems |

On Mac this code works and lets me choose multiple directories. On Win, sadly not.
My current workaround is to use the Juce-based browser dialog (by setting the useOSNativeDialogBox to false). But it would be nice to show a native Win browser dialog, for better user experience.

Has someone else seen this behaviour? Or maybe I am doing something wrong?

I am on Windows 10, JUCE 5.4.5 and Visual Studio 2019

This may explain why

1 Like

Hi Otristan,

Thanks for the fast answer. Not really what I wanted to hear :-), but good to know that it is a Win limitation.