1. Executing External Programs
- Posted by Urzumph <urzumph at hotpop.com> Oct 13, 2004
- 457 views
Hello all. I'm trying to call some external programs, but would prefer to do so without opening a dos-box. At the moment, my solution is to hide my window (I am using wxEuphoria) and then use system_exec() to execute it, which doesn't open a dos-box, but it does mean that my program is still running in the background, Which I would like to avoid. Is there any way about us?
2. Re: Executing External Programs
- Posted by h4x3r <h4x3r at bellsouth.net> Oct 13, 2004
- 436 views
On Wed, 2004-10-13 at 18:53 +1000, Urzumph wrote: > > > Hello all. > > I'm trying to call some external programs, but would prefer to do so > without opening a dos-box. At the moment, my solution is to hide my > window (I am using wxEuphoria) and then use system_exec() to execute it, > which doesn't open a dos-box, but it does mean that my program is still > running in the background, Which I would like to avoid. Is there any way > about us? > Click this link and use SW_HIDE instead of SW_SHOWNORMAL http://www.listfilter.com/cgi-bin/esearch.exu? fromMonth=1&fromYear=7&toMonth=1&toYear=7&postedBy=Euman&keywords=execute -- h4x3r <h4x3r at bellsouth.net>
3. Re: Executing External Programs
- Posted by Matt Lewis <matthewwalkerlewis at yahoo.com> Oct 13, 2004
- 467 views
Urzumph wrote: > > Hello all. > > I'm trying to call some external programs, but would prefer to do so > without opening a dos-box. At the moment, my solution is to hide my > window (I am using wxEuphoria) and then use system_exec() to execute it, > which doesn't open a dos-box, but it does mean that my program is still > running in the background, Which I would like to avoid. Is there any way > about us? > If you're using wxEuphoria, you can use wxExecute to do what you want. It's currently not wrapped extremely well (see wx_execute under the topic Random Functions). It only allows for asynchronous execution, though it is easy to change this. Change this:
global procedure wx_execute( sequence command ) atom str str = create( wxString, {command}) void = call_cdecl( wxExecute_1, {str, 0, 0}) cpp:delete_instance(str) end procedure
to this:
global constant -- execute the process asynchronously wxEXEC_ASYNC = 0, -- execute it synchronously, i.e. wait until it finishes wxEXEC_SYNC = 1, -- under Windows, don't hide the child even if it's IO is redirected (this -- is done by default) wxEXEC_NOHIDE = 2, -- under Unix, if the process is the group leader then killing -pid kills -- all children as well as pid wxEXEC_MAKE_GROUP_LEADER = 4 global function wx_execute( sequence command, integer flag ) atom str str = create( wxString, {command}) void = call_cdecl( wxExecute_1, {str, flag, 0}) cpp:delete_instance(str) return void end function
Now you can call wx_execute() either synchronously or asynchronously. This change will be made for v0.3.0 (which I'm hoping to get out in a few weeks--if anyone wants a preview/beta, let me know). Matt Lewis
4. Re: Executing External Programs
- Posted by Urzumph <urzumph at hotpop.com> Oct 14, 2004
- 509 views
Thanks a lot Matt, worked perfectly! I noticed as I was installing that you have work on wxSockets underway... Thank you for that, I have been looking forward to that for some time now.