Tamas Marki wrote:
>
> On Wed, Mar 18, 2009 at 10:59 PM, Tyler Littlefield 
> <[email protected] <mailto:tyler%40tysdomain.com>> wrote:
> >> How to be loaded only a single instance of my program in memory when
> >> Windows
> >> starts?
> >
> > You need to use a named mutex. It's been quite a while since I've done
> > this, but the idea is that you create a named mutex, and check if it
> > already exists. If so, there is already a running instance of your
> > program, and you exit the current instance.
> > Do a little googling on "named mutex" for win32, you'll probably find
> > something helpful.
> > why would you need a mutex? just check through the process list.
>
> It is a lot simpler, and probably won't trigger heuristics in
> antivirus programs (why would your program want to look at the process
> list)?
> I agree that in Unix-like operating systems it would be the way to go,
> but in Windows it's easier, cleaner, simpler.
>
> -- 
> Tamas Marki
>
> 
Or he could just simply not add his program to the registry 2 times 
(like Tyler said), which is what the problem is in the first place. ;)

Reply via email to