You may want have a look here: SingleApplication
With the above mentioned you can send a message and react on it, e.g. show and process something...
You may want have a look here: SingleApplication
With the above mentioned you can send a message and react on it, e.g. show and process something...
Last edited by Lykurg; 20th March 2009 at 12:23.
you can create advisory-lock file and check its status in main().
Allright! Thanks.
Exactly what is was looking for![]()
Just so everybody who uses this implementation using SingleApplication and more specifically the second one with QSharedMemory and QTimer...you have to modify the original code.
originally in the constructor it says
you must change byteArray.size() to a number of bytes big enough to hold your message. The way it is right now, its only like 1 byte big. I had the darndest time finding out what was wrong.Qt Code:
if (!sharedMemory.create(byteArray.size()))To copy to clipboard, switch view to plain text mode
Too bad it doesn't dynamically change in size. I set it to 30000, which is excessive, but I'm passing filenames and that can take up a lot of space.
But now, it works great. Thanks.
Good day
I'm designing an application based on Qt 5 and one of the requirements is to have it allow only one application instance running.
I have used the code found at the link you provided and it works perfect. So I want to include it in my application.
My question is: does this code has a copyright and/or license information attached to it?
Thanks.
Last edited by adrian.scarlat; 4th November 2014 at 15:12.
Bookmarks