Hiding External program

M

Matthew Maylin

I'm trying to call a external program from another. My main program is a GUI
buildin borland c++ builder, and my sibbling is compiled Matlab code.

I would like to call to the program, passing arguments and suppress the
msdos window from popping up.

I have had success with system( ) and spawnl( ) but cant seem to get the
external program to just run in the background.
 
J

Jakob Bieling

Matthew Maylin said:
I'm trying to call a external program from another. My main program is a GUI
buildin borland c++ builder, and my sibbling is compiled Matlab code.

I would like to call to the program, passing arguments and suppress the
msdos window from popping up.

I have had success with system( ) and spawnl( ) but cant seem to get the
external program to just run in the background.


You could try to get the console window with 'FindWindow' and hide it
with 'ShowWindow (.., SW_HIDE)'. This way it will also disappear from the
taskbar. Problem is that you might see a little flash for the short time the
window is created until you hide it.

If you use 'CreateProcess' instead of 'system ()' you can even pass the
SW_HIDE flag in the 'wShowWindow' member of the 'STARTUPINFO' structure
passed to 'CreateProcess', which will do the same as the above solution,
just without the flash.

Other than that, I am not sure why you posted this in comp.lang.c++ as
your question does not have anything to do with the C++ Language but rather
with the OS and its API you are working with. Try posting to a more
approriate news group, if my answer does not help (which I am not too sure
of, since I have never heard about 'spawnl ()' on the OS I am using).

hth
 
M

Matthew Maylin

Thanks Jakob. I'll look into thoose suggestions.

WW, hey I'm sorry thought it was a pporpiate for newsgroup. There are worst
crimes in the world you know.
 
J

Jakob Bieling

WW said:
Jakob Bieling wrote:
[SNIP]

Keep your Windows stuff out of here.

My way of showing the OP that his question requires a platform specific
answer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top