Did you check out the “FileDragAndDropTarget” class?
Not sure if it works with an App-Icon (i.e. minimzed application).
But I implemented this some time ago for a component inside my GUI.
I dont remember the details, but I think it was not too difficult to implement.
The application has to be running in order for that to work, though. If the application is not yet running and needs to be started when dragging files on the application icon, the dragged in files will be in the command line arguments. (Available when the JUCEApplication::initialise method is called.)
Here are my findings for OSX (tested with version 10.15):
In the Projucer go to Exporters > XCode. Look for the field “Document File Extensions” and enter your file extension there.
Now every time you drop a file with that file extension on your application icon, the function JUCEApplication::anotherInstanceStarted() is going to be called. No matter if your application was previously running or not. The file name will be part of the String argument, which anotherInstanceStarted() gives you.