Suppressing console window when calling system()



 DEVELOP > c-Plus-Plus > Suppressing console window when calling system()

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: ""
Date: 12 Sep 2006 10:08:57 PM
Object: Suppressing console window when calling system()
'Lo all.
I have a simple question I'd like help on. :]
How, if at all, would one go about suppressing the console window that
flashes up when you make at system() call in your C++ program? I'm
using Dev-C++ with GTK-- with all the 'GUI' options ticked. There is
nothing functionally wrong with the program save this flashing console
window.
The calls in question are to console apps that reside on the target OS,
the best example I could think of would be passing some info through
grep. (Why re-invent the wheel eh?)
I'd like to keep the solution as lightweight as possible, as I do plan
to make the program support both Linux and Windows, and it must be
compatible with Windows 2K. Although I am currently only compiling
under Windows, so I'll leave the Linux questions for later. :]
(So sadly http://msdn.microsoft.com/msdnmag/issues/04/02/CQA/ wouldn't
work it seems.)
Cheers in advance,
~ Steven
.

User: "Pavel"

Title: Re: Suppressing console window when calling system() 12 Sep 2006 10:28:11 PM
....

How, if at all, would one go about suppressing the console window that
flashes up when you make at system() call in your C++ program? I'm
using Dev-C++ with GTK-- with all the 'GUI' options ticked. There is
nothing functionally wrong with the program save this flashing console
window.

....

I'd like to keep the solution as lightweight as possible, as I do plan
to make the program support both Linux and Windows, and it must be
compatible with Windows 2K. Although I am currently only compiling

...
CreateProcess(..) on Windows, fork() followed by exec() and some of the
wait()s on UNIX[es]. Unfortunately, the process spawning design is
different on these OSes; hence will most probably have to #ifdef some
parts of your implementation. It is worth to check first how Cygwin
handles the issue but I doubt it has a full-fledged fork()..
Hope this helps
-Pavel
.
User: ""

Title: Re: Suppressing console window when calling system() 12 Sep 2006 11:42:39 PM
Pavel wrote:

...

How, if at all, would one go about suppressing the console window that
flashes up when you make at system() call in your C++ program? I'm
using Dev-C++ with GTK-- with all the 'GUI' options ticked. There is
nothing functionally wrong with the program save this flashing console
window.

...

I'd like to keep the solution as lightweight as possible, as I do plan
to make the program support both Linux and Windows, and it must be
compatible with Windows 2K. Although I am currently only compiling

..
CreateProcess(..) on Windows, fork() followed by exec() and some of the
wait()s on UNIX[es]. Unfortunately, the process spawning design is
different on these OSes; hence will most probably have to #ifdef some
parts of your implementation. It is worth to check first how Cygwin
handles the issue but I doubt it has a full-fledged fork()..

Hope this helps

-Pavel

Thanks for your reply. =]
It's taken some fiddling, but it's working (almost) perfect. A bit more
playing around and it should be done.
Cheers for sending me down the right Google path!
~ Steven
.



  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER