Archive: How we launch application launch, if we drag any file onto application icon.


How we launch application launch, if we drag any file onto application icon.
We have an existing java desktop application which starts, when user click on our application icon (placed on desktop) OR double click on executable(.exe). It opens the frame which allows user to select the file from native file system and uploads it to the server.

Now we would like to facilitate user, that he can pick a file from windows explorer and drag it to the application icon & drop it on the application icon on the desktop. This would start the uploading of that file on the server.

We are using JSmooth to build an executable from jar and NSIS to make installer. I would like to know..

How we can launch the application if user drops local file onto the system icon ? How we get the absolute path of file name which has been dropped onto the executable ?


if i understood you right, your question has nothing to do with NSiS itself.

But to your problem anyway:
Your Java app needs to be able to handle parameters ... at least one.
The full path will always be provided by windows if drag&drops is used or if the application is linked to a file type. You just need to take care of quoted parameters due to long file/path names.


Thanks for your response.