6582346: javaw launcher does not display MessageBox after change to the resource files
Summary: call InitCommonControlsEx to perform UI initialization
Reviewed-by: art
--- a/jdk/src/windows/native/sun/windows/ComCtl32Util.cpp Thu Jun 26 14:23:25 2008 +0400
+++ b/jdk/src/windows/native/sun/windows/ComCtl32Util.cpp Mon Jul 07 15:36:01 2008 +0400
@@ -49,6 +49,9 @@
m_bNewSubclassing = (m_lpfnSetWindowSubclass != NULL) &&
(m_lpfnRemoveWindowSubclass != NULL) &&
(m_lpfnDefSubclassProc != NULL);
+
+ fn_InitCommonControlsEx = (ComCtl32Util::InitCommonControlsExType)::GetProcAddress(hModComCtl32, "InitCommonControlsEx");
+ InitCommonControls();
}
}
}
@@ -108,3 +111,15 @@
CATCH_BAD_ALLOC_RET(0);
}
+
+void ComCtl32Util::InitCommonControls()
+{
+ if (fn_InitCommonControlsEx == NULL) {
+ return;
+ }
+
+ INITCOMMONCONTROLSEX iccex;
+ memset(&iccex, 0, sizeof(INITCOMMONCONTROLSEX));
+ iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
+ fn_InitCommonControlsEx(&iccex);
+}
--- a/jdk/src/windows/native/sun/windows/ComCtl32Util.h Thu Jun 26 14:23:25 2008 +0400
+++ b/jdk/src/windows/native/sun/windows/ComCtl32Util.h Mon Jul 07 15:36:01 2008 +0400
@@ -25,6 +25,8 @@
#include "awt_Component.h"
+#include <commctrl.h>
+
#ifndef _COMCTL32UTIL_H
#define _COMCTL32UTIL_H
@@ -81,6 +83,11 @@
PFNREMOVEWINDOWSUBCLASS m_lpfnRemoveWindowSubclass;
PFNDEFSUBCLASSPROC m_lpfnDefSubclassProc;
+ typedef BOOL (WINAPI * InitCommonControlsExType)(const LPINITCOMMONCONTROLSEX lpInitCtrls);
+ InitCommonControlsExType fn_InitCommonControlsEx;
+
+ void InitCommonControls();
+
BOOL m_bNewSubclassing;
// comctl32.dll version 6 window proc