changeset 552:d2165ac39874

6582346: javaw launcher does not display MessageBox after change to the resource files Summary: call InitCommonControlsEx to perform UI initialization Reviewed-by: art
author dcherepanov
date Mon, 07 Jul 2008 15:36:01 +0400
parents 4ccac6957211
children 9a1b30777d9d
files src/windows/native/sun/windows/ComCtl32Util.cpp src/windows/native/sun/windows/ComCtl32Util.h
diffstat 2 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/sun/windows/ComCtl32Util.cpp	Thu Jun 26 14:23:25 2008 +0400
+++ b/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/src/windows/native/sun/windows/ComCtl32Util.h	Thu Jun 26 14:23:25 2008 +0400
+++ b/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