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. ;)
- Re: [c-prog] How to load only one instance in Windows st... Brett McCoy
- [c-prog] Re: How to load only one instance in Windo... John Matthews
- [c-prog] Re: How to load only one instance in W... John Matthews
- Re: [c-prog] Re: How to load only one instance ... Tyler Littlefield
- [c-prog] Re: How to load only one instance ... John Matthews
- Re: [c-prog] Re: How to load only one insta... Tyler Littlefield
- Re: [c-prog] Re: How to load only one insta... Tamas Marki
- Re: [c-prog] Re: How to load only one insta... Tyler Littlefield
- Re: [c-prog] Re: How to load only one insta... Brett McCoy
- Re: [c-prog] Re: How to load only one instance ... Brett McCoy
- Re: [c-prog] How to load only one instance in Windows st... Christopher Coale
- Re: [c-prog] How to load only one instance in Windo... John Gaughan
- Re: [c-prog] How to load only one instance in W... Tyler Littlefield
- Re: [c-prog] How to load only one instance ... Paul Herring
- Re: [c-prog] How to load only one instance ... John Gaughan
- Re: [c-prog] How to load only one instance ... Tyler Littlefield
- [c-prog] plz hlp about graphics rsashwinkumar
- Re: [c-prog] plz hlp about graphics Thomas Hruska
- Re: [c-prog] plz hlp about graphics Tyler Littlefield
- Re: [c-prog] plz hlp about graphics Tamas Marki
- Re: [c-prog] plz hlp about graphics Tyler Littlefield
