Menu

#99 Single-instance application & passing arguments to the initial instance

Future
open
nobody
None
5
2016-03-23
2016-03-23
rednoah
No

If an application is single-instance and another instance is started then in addition to setting the original instance to the foreground it would be good if we could also somehow pass the arguments from the second (soon-to-exit) instance to the original instance and handle them.

e.g. sending file open events when users drop files on the desktop shortcut of a given application

This might help figuring out how to use Win SendMessage:
http://www.bcbjournal.org/articles/vol3/9911/Single-instance_applications.htm

Recieving Win messages apparently works via overriding WndProc:
https://msdn.microsoft.com/en-us/library/bb384843.aspx

I have no clue how to pass that into to Java code. Maybe an extra magic main method that handles String[] parameters?
http://www.advancedinstaller.com/user-guide/single-instance-application.html

Discussion


Log in to post a comment.