1. [WIN] run only one instance of selected program

I have a button in my RunDemos which causes the IDE to run, (and another
which causes Wolfgang's Tutorial to run); but if the IDE were already
running, I would want the button *not* to cause another instance of the IDE
to run, but just bring up the already running instance.  I've looked at
Wolf's examples which relate (kick-it 1,2&3), but can't figure out how to do
it.

Help!

Dan Moyer

new topic     » topic index » view message » categorize

2. Re: [WIN] run only one instance of selected program

Add this to the top of the IDE

if setAppName("Win32Lib IDE") != 0 then
    abort(0)
end if

this adds only one instance to run at any one time.

Euman
euman at bellsouth.net


----- Original Message ----- 
From: <DanMoyer at PRODIGY.NET>
To: "EUforum" <EUforum at topica.com>
Sent: Saturday, June 23, 2001 21:54
Subject: [WIN] run only one instance of selected program


> > 
> 
> I have a button in my RunDemos which causes the IDE to run, (and another
> which causes Wolfgang's Tutorial to run); but if the IDE were already
> running, I would want the button *not* to cause another instance of the IDE
> to run, but just bring up the already running instance.  I've looked at
> Wolf's examples which relate (kick-it 1,2&3), but can't figure out how to do
> it.
> 
> Help!
> 
> Dan Moyer
> 
> 
> 
> > 
> > 
> >

new topic     » goto parent     » topic index » view message » categorize

3. Re: [WIN] run only one instance of selected program

Euman,

Oh, that's not what I meant:  I'm not asking how to make the IDE *program*
know to only run one instance of itself, I'm asking how, if I *invoke* it
(or any program) from within *another* program, and the invoked program is
already running, don't run a 2nd copy, just jump into the one already
running.

Dan
----- Original Message -----
From: "Euman" <euman at bellsouth.net>

> Add this to the top of the IDE
>
> if setAppName("Win32Lib IDE") != 0 then
>     abort(0)
> end if
>
> this adds only one instance to run at any one time.
>
> Euman
> euman at bellsouth.net
>
>
> ----- Original Message -----
> From: <DanMoyer at PRODIGY.NET>
> To: "EUforum" <EUforum at topica.com>
> Sent: Saturday, June 23, 2001 21:54
> Subject: [WIN] run only one instance of selected program
>
>
> > >
> >
> > I have a button in my RunDemos which causes the IDE to run, (and another
> > which causes Wolfgang's Tutorial to run); but if the IDE were already
> > running, I would want the button *not* to cause another instance of the
IDE
> > to run, but just bring up the already running instance.  I've looked at
> > Wolf's examples which relate (kick-it 1,2&3), but can't figure out how
to do
> > it.
> >
> > Help!
> >
> > Dan Moyer
> >

new topic     » goto parent     » topic index » view message » categorize

4. Re: [WIN] run only one instance of selected program

Judith,

In Wolfgang's tutorial, "kick-it3.exw" is called "allowing only one instance
of your program to run", and *will* do just that, for the program itself.
Then I wouldn't have to try take care of it in RunDemos  :)  (although I'd
still like to know how to.)

Dan

----- Original Message -----
From: "Judith" <camping at txcyber.com>
To: "EUforum" <EUforum at topica.com>
Subject: RE: [WIN] run only one instance of selected program


>
>
>
> Euman wrote:
> > Add this to the top of the IDE
> >
> > if setAppName("Win32Lib IDE") != 0 then
> >     abort(0)
> > end if
> >
> > this adds only one instance to run at any one time.
>
> I tried using this and more than one IDE can be started. Where does the
> "Win32Lib IDE" come from? I use that only in my About box.
>
> Judith
> >
> > Euman
> > euman at bellsouth.net
> >
> Moyer

new topic     » goto parent     » topic index » view message » categorize

5. Re: [WIN] run only one instance of selected program

I stuck it in right after the include of win32lib.ew
like this and it works for me..

include win32lib.ew

 if setAppName("Win32Lib IDE") != 0 then
     abort(0)
 end if

include xpm_icon.e
include ide_xpm.ew
include ruler.ew    --Travis Beaty
include shrtPath.ew --Wolf Fritz


With this you wont be able to start another instance
of the IDE as long as both copies your trying to
run have this code in it.

e.g:
If you have an already compiled IDE.exe that doesnt
have this code then sure, it will run.

Euman
euman at bellsouth.net


----- Original Message ----- 
From: "Judith" <camping at txcyber.com>
To: "EUforum" <EUforum at topica.com>
Sent: Sunday, June 24, 2001 04:27
Subject: RE: [WIN] run only one instance of selected program


> 
> 
> 
> Euman wrote:
> > Add this to the top of the IDE
> > 
> > if setAppName("Win32Lib IDE") != 0 then
> >     abort(0)
> > end if
> > 
> > this adds only one instance to run at any one time.
> 
> I tried using this and more than one IDE can be started. Where does the 
> "Win32Lib IDE" come from? I use that only in my About box.
> 
> Judith
> > 
> > Euman
> > euman at bellsouth.net
> > 
> > 
> > ----- Original Message ----- 
> > From: <DanMoyer at PRODIGY.NET>
> > To: "EUforum" <EUforum at topica.com>
> > Sent: Saturday, June 23, 2001 21:54
> > Subject: [WIN] run only one instance of selected program
> > 
> > 
> > > > 
> > > 
> > > I have a button in my RunDemos which causes the IDE to run, (and another
> > > which causes Wolfgang's Tutorial to run); but if the IDE were already
> > > running, I would want the button *not* to cause another instance of the 
> > > IDE
> > > to run, but just bring up the already running instance.  I've looked at
> > > Wolf's examples which relate (kick-it 1,2&3), but can't figure out how 
> > > to do
> > > it.
> > > 
> > > Help!
> > > 
> > > Dan Moyer
> > > 
> > > 
> > > 
> > > > 
> > > > 
> > > > 
> > 
> > 
> > 
> 
> 
> 
> 
>

new topic     » goto parent     » topic index » view message » categorize

6. Re: [WIN] run only one instance of selected program

It doesnt have to be compiled to work.
this will work interpreted or compiled.

Its a pretty darn good idea to have this in your
IDE cause it's so large.

Euman
euman at bellsouth.net


----- Original Message -----
From: "Judith" <camping at txcyber.com>
To: "EUforum" <EUforum at topica.com>
Sent: Sunday, June 24, 2001 12:50
Subject: RE: [WIN] run only one instance of selected program


>
>
>
> Euman wrote:
> > I stuck it in right after the include of win32lib.ew
> > like this and it works for me..
> >
> > include win32lib.ew
> >
> >  if setAppName("Win32Lib IDE") != 0 then
> >      abort(0)
> >  end if
> >
> > include xpm_icon.e
> > include ide_xpm.ew
> > include ruler.ew    --Travis Beaty
> > include shrtPath.ew --Wolf Fritz
> >
> >
> > With this you wont be able to start another instance
> > of the IDE as long as both copies your trying to
> > run have this code in it
>
> >
> > e.g:
> > If you have an already compiled IDE.exe that doesnt
> > have this code then sure, it will run.
>
> Oh, I didn't understand that it had to be compiled. In any event Dan
> doesn't need me to make this change.
>
> Thanks,
>
> Judith
>
> >
> > Euman
> > euman at bellsouth.net
> >
> >
> > ----- Original Message -----
> > From: "Judith" <camping at txcyber.com>
> > To: "EUforum" <EUforum at topica.com>
> > Sent: Sunday, June 24, 2001 04:27
> > Subject: RE: [WIN] run only one instance of selected program
> >
> >
> > >
> > >
> > >
> > > Euman wrote:
> > > > Add this to the top of the IDE
> > > >
> > > > if setAppName("Win32Lib IDE") != 0 then
> > > >     abort(0)
> > > > end if
> > > >
> > > > this adds only one instance to run at any one time.
> > >
> > > I tried using this and more than one IDE can be started. Where does the
> > > "Win32Lib IDE" come from? I use that only in my About box.
<snip>

> > > > > which causes Wolfgang's Tutorial to run); but if the IDE were already
> > > > > running, I would want the button *not* to cause another instance of
the
> > > > > IDE
> > > > > to run, but just bring up the already running instance.  I've looked
at
> > > > > Wolf's examples which relate (kick-it 1,2&3), but can't figure out how
> > > > > to do
> > > > > it.
> > > > >
> > > > > Help!
> > > > >
> > > > > Dan Moyer
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > >
> > > > > >
> <snip>
>
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

7. Re: [WIN] run only one instance of selected program

make sure your copy of win32lib has this.

global function setAppName(sequence pName)

if it doesnt, check your version of win32lib again.
Im useing win98SE and win32lib 0.55.1 19/Dec/2000

Euman
euman at bellsouth.net


----- Original Message ----- 
From: "Judith" <camping at txcyber.com>
To: "EUforum" <EUforum at topica.com>
Sent: Sunday, June 24, 2001 13:04
Subject: RE: [WIN] run only one instance of selected program


> 
> 
> 
> Euman wrote:
> > It doesnt have to be compiled to work.
> 
> Well, it doesn't work for me. I put it in right were you show and run 
> IDE and then run it again. Both are in the taskbar.
> 
> I'm using win98SE and win32lib.ew v 55.1.
> 
> So what am I doing wrong?
> 
> > this will work interpreted or compiled.
> > 
> > Its a pretty darn good idea to have this in your
> > IDE cause it's so large.
> > 
> > Euman
> > euman at bellsouth.net
> > 
> > 
> > ----- Original Message -----
> > From: "Judith" <camping at txcyber.com>
> > To: "EUforum" <EUforum at topica.com>
> > Sent: Sunday, June 24, 2001 12:50
> > Subject: RE: [WIN] run only one instance of selected program
> > 
> > 
> > >
> > >
> > >
> > > Euman wrote:
> > > > I stuck it in right after the include of win32lib.ew
> > > > like this and it works for me..
> > > >
> > > > include win32lib.ew
> > > >
> > > >  if setAppName("Win32Lib IDE") != 0 then
> > > >      abort(0)
> > > >  end if
> > > >
> > > > include xpm_icon.e
> > > > include ide_xpm.ew
> > > > include ruler.ew    --Travis Beaty
> > > > include shrtPath.ew --Wolf Fritz
> > > >
> > > >
> > > > With this you wont be able to start another instance
> > > > of the IDE as long as both copies your trying to
> > > > run have this code in it
> > >
> > > >
> > > > e.g:
> > > > If you have an already compiled IDE.exe that doesnt
> > > > have this code then sure, it will run.
> > >
> > > Oh, I didn't understand that it had to be compiled. In any event Dan
> > > doesn't need me to make this change.
> > >
> > > Thanks,
> > >
<snip>

> 
> 
>

new topic     » goto parent     » topic index » view message » categorize

8. Re: [WIN] run only one instance of selected program

Bernie,

Sounds good, but I don't know how to find out what programs are running,
programmatically.  How do I do that?

Dan

----- Original Message -----
From: "Bernie Ryan" <xotron at localnet.com>



> DanMoyer at PRODIGY.NET wrote:
>
>    You can enumerate all the running windows and then search for
>    the window thats title is the same as the one you want,
>    Then bring it to the top most window; if doesn't exist then
>    launch it.
>
> Bernie
>
>

new topic     » goto parent     » topic index » view message » categorize

9. Re: [WIN] run only one instance of selected program

> Bernie,
>
> Sounds good, but I don't know how to find out what programs are running,
> programmatically.  How do I do that?
>
> Dan

I wrote some functions to do that a while ago for another project,
I've just packaged them up and put them on my webpage at:

http://www.rat-software.com/projects.html

Hope they're useful :)

Thomas Parslow (PatRat) ICQ #:26359483
Rat Software
http://www.rat-software.com/
Please leave quoted text in place when replying

new topic     » goto parent     » topic index » view message » categorize

10. Re: [WIN] run only one instance of selected program

Thomas,

Thanks, I'll give it a look.  Judith will probably be making single instance
invocation work within the IDE, so I may not need to do it "externally" for
RunDemos, but I'd like to know how it's done, anyway.

Dan

----- Original Message -----
From: "Thomas Parslow (PatRat)" <patrat at rat-software.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: [WIN] run only one instance of selected program

<Dan wrote:>


>
> > Bernie,
> >
> > Sounds good, but I don't know how to find out what programs are running,
> > programmatically.  How do I do that?
> >
> > Dan
>
> I wrote some functions to do that a while ago for another project,
> I've just packaged them up and put them on my webpage at:
>
> http://www.rat-software.com/projects.html
>
> Hope they're useful :)
>
> Thomas Parslow (PatRat) ICQ #:26359483
> Rat Software
> http://www.rat-software.com/
> Please leave quoted text in place when replying
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu