Article View: borland.public.cppbuilder.nativeapi
Article #4375Re: Mutex troubles?
From: Bruce Salzman
Date: Fri, 24 Feb 2006 20:59
Date: Fri, 24 Feb 2006 20:59
17 lines
1480 bytes
1480 bytes
"Nate Lockwood" <RNLockwoodREMOVE@attglobal.net> wrote in message news:43ff726e$1@newsgroups.borland.com... > I'm trying to have my program detect that another instance is > running, send a "Show" message to the already running instance, and > then return. I'm using Builder 6. > > It appears that I always get a non null mutex so the message is > never sent. Here's some code. > You *should* get the handle to the existing mutex. You have to call GetLastError() after CreateMutex() to see if it returns ERROR_ALREADY_EXISTS. -- Bruce
Technical Details
Message-ID:
<43ff7389$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<43ff726e$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,7b6bdf1fac3d7d96 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: " Bruce Salzman" <bruce@nospam.org> Newsgroups: borland.public.cppbuilder.nativeapi References: <43ff726e$1@newsgroups.borland.com> Subject: Re: Mutex troubles? Date: Fri, 24 Feb 2006 14:59:03 -0600 Lines: 19 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 NNTP-Posting-Host: 24.94.228.231 Message-ID: <43ff7389$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1140814729 24.94.228.231 (24 Feb 2006 12:58:49 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail