Re: how to check if app is already running?

by Willy Denoyette [MVP] on 12/13/2007 11:53:00 PM <A1b2c3d4@community.nospam> wrote in message
news:A8291911-EBBB-4149-9431-9D0E218CBC10@microsoft.com...
> Hi,
>
> Windows XP Pro SP2, Workgroup
>
> The mutex approach doesn't always work for me. It works in the following
> scenarios:
>
> 1. User A attempts to launch a second instance of the process. User A
> launched the first instance (ie same user, same workstation)
>
> 2. User A attempts to launch a second instance of the process. User B
> launched the first instance. Both instances are running in the same
> workstation (e.g. RunAs was used to change the owner of one of the
> processes).
>
> It doesn't seem to work when user A attempts to launch a second instance
> of
> the process where user B launched the first instance in a different
> workstation (e.g. launch the process, switch to a different user (and
> therefore a different workstation) and launch a second instance of the
> process).
>
> I always thought that named mutexes provided exclusivity over the entire
> machine...

Only if the mutex is of a global type like....
"Global\MyMutex"



Willy.