#include "wx/dde.h" // for WX_DDE hack in wxExecute
#endif // wxUSE_IPC
-// implemented in utils.cpp
-extern "C" WXDLLIMPEXP_BASE HWND
-wxCreateHiddenWindow(LPCTSTR *pclassname, LPCTSTR classname, WNDPROC wndproc);
+#include "wx/msw/private/hiddenwin.h"
// ----------------------------------------------------------------------------
// constants
si.hStdOutput = pipeOut[wxPipe::Write];
si.hStdError = pipeErr[wxPipe::Write];
- // when the std IO is redirected, we don't show the (console) process
- // window by default, but this can be overridden by the caller by
- // specifying wxEXEC_NOHIDE flag
- if ( !(flags & wxEXEC_NOHIDE) )
- {
- si.dwFlags |= STARTF_USESHOWWINDOW;
- si.wShowWindow = SW_HIDE;
- }
-
// we must duplicate the handle to the write side of stdin pipe to make
// it non inheritable: indeed, we must close the writing end of pipeIn
// before launching the child process as otherwise this handle will be
}
#endif // wxUSE_STREAMS
+ // The default logic for showing the console is to show it only if the IO
+ // is not redirected however wxEXEC_{SHOW,HIDE}_CONSOLE flags can be
+ // explicitly specified to change it.
+ if ( (flags & wxEXEC_HIDE_CONSOLE) ||
+ (redirect && !(flags & wxEXEC_SHOW_CONSOLE)) )
+ {
+ si.dwFlags |= STARTF_USESHOWWINDOW;
+ si.wShowWindow = SW_HIDE;
+ }
+
+
PROCESS_INFORMATION pi;
DWORD dwFlags = CREATE_SUSPENDED;