I've looked into this a little (or more than a little) and either I can't find exactly what I'm looking for or it's one of those situations where I'm just being resistant to the truth.
Basically what I want is the ability to mimic the behaviour one gets on Mac for free: i.e., double-clicking an associated document type when an instance of the application is already running will send an "open files" event to that instance instead of launching — as on Windows and Linux — a new instance.
Now, wxSingleInstanceChecker can prevent the launch (or at least terminate after launch to prevent multiple running instances), but before I dig further into two separate platform-specific methods, is there a wx-friendly way of doing this that anyone else has cooked up? (I guess there is DDE, but that seems a little heavyweight for this if there's another alternative.)
Thanks, soldiers.
Single instance: open instead of launch Topic is solved
Re: Single instance: open instead of launch
I am afraid you are out of luck, see these answers a wxWidgets maintainer gave to similar questions:
https://stackoverflow.com/questions/352 ... 9#35291999
https://stackoverflow.com/questions/459 ... 5#45938145
https://stackoverflow.com/questions/352 ... 9#35291999
https://stackoverflow.com/questions/459 ... 5#45938145
Re: Single instance: open instead of launch
The method Vadim described is what i use in my applications. My code as it is is a little messy, but i think it could be turned in a single mix-in class. I'll see if i can strip something together, but it won't be before thursday.
Use the source, Luke!
Re: Single instance: open instead of launch
Thanks — figured that would probably be the approach. (I hadn't seen those SO links: thanks for those.)