Originally posted by hspc
anyway this is my solution for this prolem :
[....]
How does it work ?
it creates a mutex (shared object that hace a uniqe name)..
if you try to recreate it you get the error : ERROR_ALREADY_EXISTS
this is the whole idea...
I like your solution.
Another way (not this good, however)
is to have a check in sub main for a particular form
(FindWindow api will find it even if it is not visible)
you load and do not show. If you find it, program is
already running, if not, it is first instance
ie attached code
But your solution is better...
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.