6596475: (launcher) javaw should call InitCommonControls
Summary: javaw does not show error window after manifest changes.
Reviewed-by: darcy
diff --git a/src/windows/bin/java_md.c b/src/windows/bin/java_md.c
index 2e1c787..f252e0b 100644
--- a/src/windows/bin/java_md.c
+++ b/src/windows/bin/java_md.c
@@ -33,6 +33,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <wtypes.h>
+#include <commctrl.h>
 
 #include <jni.h>
 #include "java.h"
@@ -52,11 +53,6 @@
 
 static jboolean _isjavaw = JNI_FALSE;
 
-void
-SetJavaw()
-{
-    _isjavaw = JNI_TRUE;
-}
 
 jboolean
 IsJavaw()
@@ -999,3 +995,20 @@
 
 /* Linux only, empty on windows. */
 void SetJavaLauncherPlatformProps() {}
+
+void
+InitLauncher(boolean javaw)
+{
+    INITCOMMONCONTROLSEX icx;
+
+    /*
+     * Required for javaw mode MessageBox output as well as for
+     * HotSpot -XX:+ShowMessageBoxOnError in java mode, an empty
+     * flag field is sufficient to perform the basic UI initialization.
+     */
+    memset(&icx, 0, sizeof(INITCOMMONCONTROLSEX));
+    icx.dwSize = sizeof(INITCOMMONCONTROLSEX);
+    InitCommonControlsEx(&icx);
+    _isjavaw = javaw;
+    JLI_SetTraceLauncher();
+}