Here is one (it also mentions QtSingleApplication. ;-)
Often, the best solutions are platform-specific. You can use named pipes, a TCP or UPD connection, a simple file (these are all portable). In MSWin, the standard trick is a named mutex (not available on other platforms). I haven't looked at the code for QtSingleApplication, but it suggests the use of some form of pipe or socket just from its method list.
To the O.P.'s question. When the new instance checks for a previous one, the previous one will receive the text you send it. When it receives that message, it can activate its main window. It may not make the app jump to front (there's already a seperate thread about this), but it will restore its window if minimized, etc.




Reply With Quote



Bookmarks