mmhhh...

right, i forgot OpenMutex use the name and not the Handle.
I wait to open that web page.

Thanks.

----- Original Message -----
From: "Rob Kennedy" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, April 09, 2005 8:37 PM
Subject: Re: [delphi-en] Microsoft SDK


>
> Mauro Russo wrote:
> > Well, Mutexes is important too and i use it,
> > but i explained just the proble.
>
> Not really. You explained your idea for solving a problem. You still
> haven't really described what the problem is.
>
> > Really, the situation is little bit more complicated and i use
> > already mutex to jump other problems.
> >
> > Well, i just thought i can use Handle of Mutex to do what i
> > excepted to do by Application.Handle... using OpenMutex instead of tha
> > funciont i'm looking for.
>
> Stop worrying about the value of a handle. A mutex is a kernel object,
> and handles to kernel objects are completely meaningless outside the
> process that created them, so that leaves you in an even worse situation
> than when you were thinking about comparing window handles. (Window
> handles are valid globally.)
>
> When you create a mutex, you get to give it a name. When two processes
> try to create a mutex with the same name, they wind up with handles to
> the same mutex. (The numeric values of the THandle variables will be
> different, but they still refer to the same mutex object in the OS.)
>
> The OpenMutex function isn't usually of much use. Use CreateMutex
> instead. You can call GetLastError to see whether your call to
> CreateMutex was the first for the given mutex name or whether the mutex
> already existed. From that, you can conclude whether your instance of a
> program was the first or whether there was already another instance
running.
>
> --
> Rob
>
>
> -----------------------------------------------------
> Home page: http://groups.yahoo.com/group/delphi-en/
> To unsubscribe: [EMAIL PROTECTED]
> Yahoo! Groups Links
>
>
>
>
>
>
>
>



-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to