1. Win32Lib: how run another program?
- Posted by Dan B Moyer <DANMOYER at PRODIGY.NET> Aug 30, 2000
- 505 views
- Last edited Aug 31, 2000
How can I make another Euphoria program run from within one that is running? I tried looking at David Cuny's IDE, which runs the program under development, but I don't really understand what it means. Here's what I found that apparently does it: result = system_exec( "exw \"" & fName & "\"", 2 ) what I specifically don't understand is the "exw\" & the "\" & the 2 <sickly grin> Dan
2. Re: Win32Lib: how run another program?
- Posted by Kat <gertie at PELL.NET> Aug 30, 2000
- 485 views
- Last edited Aug 31, 2000
On 30 Aug 2000, at 20:53, Dan B Moyer wrote: > How can I make another Euphoria program run from within one that is running? > I tried looking at David Cuny's IDE, which runs the program under > development, but I don't really understand what it means. Here's what I > found that apparently does it: > > result = system_exec( "exw \"" & fName & "\"", 2 ) > > what I specifically don't understand is the "exw\" & the "\" & the 2 > <sickly grin> What i'd like to know is: does windoze start fName and come right back to the next line after that, leaving fName to go on about it's business as a standalone application? ) Kat, hoping!
3. Re: Win32Lib: how run another program?
- Posted by Dan B Moyer <DANMOYER at PRODIGY.NET> Aug 30, 2000
- 483 views
- Last edited Aug 31, 2000
Kat, I would guess NOT, (though I could be wrong), at least as it's implemented in David's IDE, 'cause if you run an app under development there (AUD), you can't close out the IDE & have the app running by itself, you have to close the app & then the IDE. Could be another way to use the command, maybe, though, that would do it. I'd be satisfied to just know how to use the command in the fashion he did. :) Dan ----- Original Message ----- From: "Kat" <gertie at PELL.NET> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Wednesday, August 30, 2000 9:40 PM Subject: Re: Win32Lib: how run another program? > On 30 Aug 2000, at 20:53, Dan B Moyer wrote: > > > How can I make another Euphoria program run from within one that is running? > > I tried looking at David Cuny's IDE, which runs the program under > > development, but I don't really understand what it means. Here's what I > > found that apparently does it: > > > > result = system_exec( "exw \"" & fName & "\"", 2 ) > > > > what I specifically don't understand is the "exw\" & the "\" & the 2 > > <sickly grin> > > What i'd like to know is: does windoze start fName and come right back to the next > line after that, leaving fName to go on about it's business as a standalone application? > ) > > Kat, > hoping!
4. Re: Win32Lib: how run another program?
- Posted by Dan B Moyer <DANMOYER at PRODIGY.NET> Aug 30, 2000
- 479 views
- Last edited Aug 31, 2000
Jeeze! Nevermind. I can't believe I didn't even *think* to read the manual! And not only that, but clicking on Euphoria programs to run them has made me completely forget that "exw" is the NORMAL way to evoke the windows version of the interpreter! Sigh! Two steps forward, one step backward (at least!). Dan (feeling sheepish) ----- Original Message ----- From: "Dan B Moyer" <DANMOYER at prodigy.net> To: "Euphoria Mail List" <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Wednesday, August 30, 2000 8:53 PM Subject: Win32Lib: how run another program? > How can I make another Euphoria program run from within one that is running? > I tried looking at David Cuny's IDE, which runs the program under > development, but I don't really understand what it means. Here's what I > found that apparently does it: > > result = system_exec( "exw \"" & fName & "\"", 2 ) > > what I specifically don't understand is the "exw\" & the "\" & the 2 > <sickly grin> > > Dan >
5. Re: Win32Lib: how run another program?
- Posted by Bernie <xotron at PCOM.NET> Aug 31, 2000
- 510 views
On Wed, 30 Aug 2000 20:53:20 -0700, Dan B Moyer <DANMOYER at PRODIGY.NET> wrote: >How can I make another Euphoria program run from within one that is running? >I tried looking at David Cuny's IDE, which runs the program under >development, but I don't really understand what it means. Here's what I >found that apparently does it: > > result = system_exec( "exw \"" & fName & "\"", 2 ) > >what I specifically don't understand is the "exw\" & the "\" & the 2 ><sickly grin> > Dan: I think what is confusing you is the \" When ever you place double qoutes INSIDE a STRING the interpter will not know which qoutation marks is the end of of a string. Placing the \ ( escape character ) tells the interpter to IGNORE the next double qoute because it is part of the text and not the end of the string. Bernie
6. Re: Win32Lib: how run another program?
- Posted by Matthew Lewis <MatthewL at KAPCOUSA.COM> Aug 31, 2000
- 498 views
> Here's what I > > found that apparently does it: > > > > result = system_exec( "exw \"" & fName & "\"", 2 ) > > > > what I specifically don't understand is the "exw\" & the "\" & the 2 > > <sickly grin> > > What i'd like to know is: does windoze start fName and come > right back to the next > line after that, leaving fName to go on about it's business > as a standalone application? Win32Lib wraps the API function ShellExecute, which, technically, is a function (if I could get it to work properly). However, one of the quirks of C, which Windows is written in, is that you are free to ignore the return value of a function, so instead of: linkFunc(), use linkProc() Using the former would cause your program to wait until the app is closed (this is how system_exec works), and the latter should behave as you (and I) would like. Maybe Rob could implement an offshoot of system_exec that does this? I've tried using system(), but it looks like Word opens up and immediately closes. Matt
7. Re: Win32Lib: how run another program?
- Posted by wolfgang fritz <wolfritz at king.igs.net> Aug 31, 2000
- 490 views
> Win32Lib wraps the API function ShellExecute, which, technically, is a > function (if I could get it to work properly). ( this is a rather 'simplified' wrap ) Check out my 'tutorial' engines. Depending on which version you have, it's either Tutor3.exw, ... or WinTutor.exw. [ in my latest 'beta' ] It uses shellExecute() for *everything*... My address7.zip also uses shellExecute() to start an e-mail... ...and Kat, you might try shellExecute() with the following flag. SW_SHOWMINNOACTIVE -- Displays the window as a minimized window. The active window remains active. ...haven't tried it, but if a program opened this way actually *does* anything while it's minimized, I suppose this is what you might be looking for. Wolf
8. Re: Win32Lib: how run another program?
- Posted by Matthew Lewis <MatthewL at KAPCOUSA.COM> Aug 31, 2000
- 489 views
> From: wolfgang fritz > > Check out my 'tutorial' engines. > Depending on which version you have, it's either Tutor3.exw, > ... or WinTutor.exw. [ in my latest 'beta' ] > It uses shellExecute() for *everything*... > My address7.zip also uses shellExecute() to start an e-mail... > > ...and Kat, you might try shellExecute() with the following flag. > > SW_SHOWMINNOACTIVE -- Displays the window as a minimized > window. The active > window remains active. > > ...haven't tried it, but if a program opened this way actually *does* > anything while it's minimized, I suppose this is what you > might be looking > for. Well, I sort of got it to work. One problem was that I wasn't using the flags properly. Also, it doesn't seem to like command line arguments, like "winword.exe document.txt". To run and forget, you need to add: xShellExecuteNoRet = linkProc( shell32, "ShellExecuteA", {C_LONG, C_LONG, C_LONG, C_LONG, C_LONG, C_LONG} ) global procedure shellExecuteNoRet( sequence cmd, sequence file, atom style ) -- call ShellExecute to display a file atom result, file_string, cmd_string -- convert to strings file_string = allocate_string( file ) cmd_string = allocate_string( cmd ) -- call ShellExecute c_proc( xShellExecuteNoRet, { getHandle( mainWindow ), cmd_string, file_string, 0, 0, style } ) -- free the strings free( cmd_string ) free( file_string ) end procedure The procedure is the same as shellExecute(), except it doesn't wait for the exit code from windows. Matt
9. Re: Win32Lib: how run another program?
- Posted by "Hawke'" <mikedeland at NETZERO.NET> Aug 31, 2000
- 470 views
not sure if this will do what you want, but u can try: constant RunInBackGround = "start /m " constant RunInForeGround = "start /max " consant ProgramToRun = "C:\\directory\\program.exe" procedure BGRun(sequence filename) system(RunInBackGround & filename,2) end procedure procedure FGRun(sequence filename) system(RunInForeGround & filename,2) end procedure code isnt tested, but i remember experimenting with the "start" command in windows and being pleasantly suprised...also i KNOW that i was using it at one time in the past for EUServer... hope this will work for u as u want it to... typing "start /?" at a dos prompt will give you more info about it... --Hawke' ----- Original Message ----- From: Kat <gertie at PELL.NET> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Wednesday, August 30, 2000 9:40 PM Subject: Re: Win32Lib: how run another program? > On 30 Aug 2000, at 20:53, Dan B Moyer wrote: > > > How can I make another Euphoria program run from within one that is running? > > I tried looking at David Cuny's IDE, which runs the program under > > development, but I don't really understand what it means. Here's what I > > found that apparently does it: > > > > result = system_exec( "exw \"" & fName & "\"", 2 ) > > > > what I specifically don't understand is the "exw\" & the "\" & the 2 > > <sickly grin> > > What i'd like to know is: does windoze start fName and come right back to the > next > line after that, leaving fName to go on about it's business as a standalone > application? > ) > > Kat, > hoping! > ____________NetZero Free Internet Access and Email_________ Download Now http://www.netzero.net/download/index.html Request a CDROM 1-800-333-3633 ___________________________________________________________