6582346: javaw launcher does not display MessageBox after change to the resource files

Call InitCommonControlsEx to perform UI initialization

Reviewed-by: art
This commit is contained in:
Dmitry Cherepanov 2008-07-07 15:36:01 +04:00
parent 86ac930e55
commit 1267284a6f
2 changed files with 22 additions and 0 deletions

View File

@ -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);
}

View File

@ -25,6 +25,8 @@
#include "awt_Component.h"
#include <commctrl.h>
#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