jdk/src/windows/native/java/lang/ProcessImpl_md.c
changeset 20191 f0e23e7272d6
parent 19372 e404c834f1cd
child 22962 309eaab8c853
--- a/jdk/src/windows/native/java/lang/ProcessImpl_md.c	Fri Sep 20 17:11:32 2013 -0700
+++ b/jdk/src/windows/native/java/lang/ProcessImpl_md.c	Mon Sep 23 04:05:42 2013 +0100
@@ -308,7 +308,11 @@
 
                 if (success) {
                     PROCESS_INFORMATION pi;
-                    DWORD processFlag = CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT;
+                    DWORD processFlag = CREATE_UNICODE_ENVIRONMENT;
+
+                    /* Suppress popping-up of a console window for non-console applications */
+                    if (GetConsoleWindow() == NULL)
+                        processFlag |= CREATE_NO_WINDOW;
 
                     si.dwFlags = STARTF_USESTDHANDLES;
                     if (!CreateProcessW(