Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #7887

Re: Prevent Multiple Instances

From James Martin <james@northwoodlumber.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Prevent Multiple Instances
Date 2015-03-19 08:33 -0400
Organization A noiseless patient Spider
Message-ID <meefch$d1f$1@dont-email.me> (permalink)
References <me9osc$d2h$1@dont-email.me> <meecrr$3pc$1@dont-email.me>

Show all headers | View raw


Looks good! John Martin's solution worked the same way, and it works. 
I'll use your code on another program.

James

On 15-03-19 07:45 AM, Craig Dawson wrote:
> Hi James,
> I put the following at the start() of my app...
> Works great!
> Regards, Craig.
>
> IF AlreadyRunning( "PNS.EXE" ) // Nice!
>      oAppWin := AppWindow{}
>      ErrorBox{oAppWin, "You can't launch this program twice at the same
> time!"}:Show()
>      BREAK // STOP
> ENDIF
>
> FUNCTION AlreadyRunning( cID_APP AS STRING ) AS LOGIC
> // Author : Richard Press (with lots of help)
> CreateMutex(NULL,TRUE,String2Psz(cID_APP))
> RETURN (GetLastError()==ERROR_ALREADY_EXISTS)
>
>
>
> "James Martin" <james@northwoodlumber.com> wrote in message
> news:me9osc$d2h$1@dont-email.me...
>> I would like to know a simple way to prevent an app from running twice that
>> avoids the problem of leaving a flag that prevents any further execution
>> when the program terminates with an error.
>>
>> James
>
>

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Prevent Multiple Instances James Martin <james@northwoodlumber.com> - 2015-03-17 13:44 -0400
  Re: Prevent Multiple Instances JohnMartens <martens@tennishulp.info> - 2015-03-17 18:55 +0100
  Re: Prevent Multiple Instances "Craig Dawson" <craig_dawson@hotmail.com> - 2015-03-19 22:45 +1100
    Re: Prevent Multiple Instances James Martin <james@northwoodlumber.com> - 2015-03-19 08:33 -0400

csiph-web