hidden commandline-tool Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
MoonKid
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 543
Joined: Wed Apr 05, 2006 9:39 am
Contact:

hidden commandline-tool

Post by MoonKid » Wed Mar 04, 2009 11:25 am

I have a wxWidgets application and it call a extern commandline-tool. The tool apear in the windows-taskbar and a terminal-box ("dos-box") is opend while it runs.

There is no need for this, because the tool doesn't need input from the user or output to the screen.

Is it possible to call/run a commandline-tool from my wx-application in a hidden state?

Frank
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 211
Joined: Sat Jan 01, 2005 6:19 pm

Post by Frank » Wed Mar 04, 2009 12:19 pm

If you use wxExecute/wxProcess you can supress the Console-Window. Wx hides it, when you redirect input and output.

TrV
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 630
Joined: Wed Jul 04, 2007 1:12 pm

Post by TrV » Fri Mar 06, 2009 11:20 am

Yes. Just use an unused process :

Code: Select all

wxProcess* proc = new wxProcess(wxPROCESS_REDIRECT); // unused process in order to keep dos window hidden
wxString cmdLine;
...

wxExecute(cmdLine, wxEXEC_SYNC, proc);

delete proc;

stevelam
Earned some good credits
Earned some good credits
Posts: 114
Joined: Fri Apr 14, 2006 11:01 am

Post by stevelam » Fri Mar 06, 2009 5:01 pm

Or like this:

Code: Select all

wxArrayString output, errors;
wxString cmdLine;
wxExecute (cmdLine, output, errors, wxEXEC_SYNC);

Post Reply