diff --git a/jdk/src/windows/native/sun/windows/ComCtl32Util.cpp b/jdk/src/windows/native/sun/windows/ComCtl32Util.cpp index d9309a6856b..d00ef6e95e8 100644 --- a/jdk/src/windows/native/sun/windows/ComCtl32Util.cpp +++ b/jdk/src/windows/native/sun/windows/ComCtl32Util.cpp @@ -49,6 +49,9 @@ void ComCtl32Util::InitLibraries() { m_bNewSubclassing = (m_lpfnSetWindowSubclass != NULL) && (m_lpfnRemoveWindowSubclass != NULL) && (m_lpfnDefSubclassProc != NULL); + + fn_InitCommonControlsEx = (ComCtl32Util::InitCommonControlsExType)::GetProcAddress(hModComCtl32, "InitCommonControlsEx"); + InitCommonControls(); } } } @@ -108,3 +111,15 @@ LRESULT ComCtl32Util::SharedWindowProc(HWND hwnd, UINT msg, 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); +} diff --git a/jdk/src/windows/native/sun/windows/ComCtl32Util.h b/jdk/src/windows/native/sun/windows/ComCtl32Util.h index b90869ba39e..e410f30760e 100644 --- a/jdk/src/windows/native/sun/windows/ComCtl32Util.h +++ b/jdk/src/windows/native/sun/windows/ComCtl32Util.h @@ -25,6 +25,8 @@ #include "awt_Component.h" +#include + #ifndef _COMCTL32UTIL_H #define _COMCTL32UTIL_H @@ -81,6 +83,11 @@ class ComCtl32Util 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