To do this, you’ll need to use a custom standalone window.
There’s a good overview of how to get that up and running here:
You can get a handle to the standalone plugin holder by including “juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h” and then doing something like this after an output is selected:
if (auto* holder = StandalonePluginHolder::getInstance())
holder->player.setMidiOutput (selectedOutput);
You may also need to call holder->deviceManager.setDefaultMidiOutputDevice (...)
in order to ensure that the selected midi output is saved properly when quitting the app.