-
From: Scott Allen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 2 March 2005 7:08 AM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] System global Mutex
Hi Neils:
As others have mentioned, you can preface the mutex with Global\.
You will see access denied errors if the second i
Hi Neils:
As others have mentioned, you can preface the mutex with Global\.
You will see access denied errors if the second instance of the program runs
under a different user identity. By default, I believe only the creator and
SYSTEM have privileges to touch the mutex. It might take some PInvok
TECTED] On Behalf Of David Lanouette
Sent: Tuesday, March 01, 2005 1:25 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] System global Mutex
You could also just look to see if the process is already running. I would
think this would be lighter weight (don't need to keep
-DOTNET] System global Mutex
Neils Christoffersen wrote:
> Therefore, I need some sort of "system global" mutex, or another
> mechanism to achieve this.
> What's the best way?
Prefix your mutex name with "Global\". I haven't actually tried this in
.NET, bu
You could also just look to see if the process is already running. I would
think this would be lighter weight (don't need to keep a mutex around all
the time)
ex.
Process currProcess = Process.GetCurrentProcess();
Process [] runningProcesses =
Process.GetProcessesByName(currProcess.ProcessName);
You need to prefix the name with "Global\". See the CreateMutex()
documentation in the Win32 docs.
--
manaaki whenua | manaaki tangata | haere whakamua
http://hestia.typepad.com/flatlander | mailto:[EMAIL PROTECTED]
-Original Message-
From: Unmoderated discussion of advanced .NET topics
Neils Christoffersen wrote:
> Therefore, I need some sort of "system global" mutex, or another mechanism
> to achieve this.
> What's the best way?
Prefix your mutex name with "Global\". I haven't actually tried this
in .NET, but I'm sure it wraps the CreateMutex API, which, by default,
creates