1. Executing External Programs

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?

new topic     » topic index » view message » categorize

2. Re: Executing External Programs

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>

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

3. Re: Executing External Programs

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

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

4. Re: Executing External Programs

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.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu