summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/createprocess.c
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2001-10-02 03:09:38 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2001-10-02 03:09:38 +0000
commiteeb486bd483bdf707d009f727705d856d50fa88d (patch)
tree13ba4e1715584e1bf0f8066d0475c38453c14379 /otherlibs/win32unix/createprocess.c
parent4526d1d8216beb31b33f847649921133cad1015b (diff)
create new console if not available
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3821 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/win32unix/createprocess.c')
-rw-r--r--otherlibs/win32unix/createprocess.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/otherlibs/win32unix/createprocess.c b/otherlibs/win32unix/createprocess.c
index 6e84c78da..a99af4036 100644
--- a/otherlibs/win32unix/createprocess.c
+++ b/otherlibs/win32unix/createprocess.c
@@ -39,15 +39,18 @@ value win_create_process_native(value cmd, value cmdline, value env,
si.hStdInput = Handle_val(fd1);
si.hStdOutput = Handle_val(fd2);
si.hStdError = Handle_val(fd3);
- /* If we do not have a console window, then we must run
- console mode applications as detached processes.
+ /* If we do not have a console window, then we must create one
+ before running the process (keep it hidden for apparence).
Otherwise, a new console is created and the redirections
are ignored. If we're running a GUI application, the
- detached / non-detached flag doesn't matter. */
+ newly created console doesn't matter. */
if (win_has_console())
flags = 0;
- else
- flags = DETACHED_PROCESS;
+ else {
+ flags = CREATE_NEW_CONSOLE;
+ si.dwFlags |= STARTF_USESHOWWINDOW;
+ si.wShowWindow = SW_HIDE;
+ }
/* Create the process */
if (! CreateProcess(exefile, String_val(cmdline), NULL, NULL,
TRUE, flags, envp, NULL, &si, &pi)) {