From 61e43dca25a80a451cf2b7dbbc4931a8f2a96d80 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 20 Sep 2013 12:59:56 +0000 Subject: using Uxtheme git-svn-id: http://svn.miranda-ng.org/main/trunk@6137 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/LangMan/src/options.cpp | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) (limited to 'plugins/LangMan/src/options.cpp') diff --git a/plugins/LangMan/src/options.cpp b/plugins/LangMan/src/options.cpp index 2420509699..f7eaac87c7 100644 --- a/plugins/LangMan/src/options.cpp +++ b/plugins/LangMan/src/options.cpp @@ -39,12 +39,6 @@ static HIMAGELIST CreateRadioImages(COLORREF clrBk, COLORREF clrText) HBITMAP hbm, hbmPrev; HIMAGELIST himl = NULL; - /* the WinXP+ themed way */ - HTHEME (WINAPI *pfnOpenThemeData)(HWND, const WCHAR*); - HTHEME (WINAPI *pfnCloseThemeData)(HTHEME); - HRESULT (WINAPI *pfnDrawThemeBackground)(HTHEME, HDC, int, int, const RECT*, const RECT*); - HMODULE hUxThemeDLL = LoadLibrary(_T("UXTHEME")); /* all ascii */ - /* draw bitmap */ hdcScreen = GetDC(NULL); if (hdcScreen!=NULL) { @@ -57,27 +51,16 @@ static HIMAGELIST CreateRadioImages(COLORREF clrBk, COLORREF clrText) if (hbm!=NULL) { hbmPrev = (HBITMAP)SelectObject(hdc, hbm); if (hbmPrev!=NULL) { /* error on select? */ - /* the WinXP+ themed way */ - if (hUxThemeDLL!=NULL) { - *(PROC*)&pfnOpenThemeData = GetProcAddress(hUxThemeDLL, "OpenThemeData"); - *(PROC*)&pfnCloseThemeData = GetProcAddress(hUxThemeDLL, "CloseThemeData"); - *(PROC*)&pfnDrawThemeBackground = GetProcAddress(hUxThemeDLL, "DrawThemeBackground"); - if (pfnOpenThemeData!=NULL && pfnCloseThemeData!=NULL && pfnDrawThemeBackground!=NULL) { - HTHEME hTheme; - hTheme = pfnOpenThemeData(NULL, L"Button"); - if (hTheme!=NULL) { - SetRect(&rc, 0, 0, size.cx, size.cy); - /* unchecked */ - if (!pfnDrawThemeBackground(hTheme, hdc, BP_RADIOBUTTON, RBS_UNCHECKEDNORMAL, &rc, NULL)) { - /* checked */ - OffsetRect(&rc, size.cx, 0); - if (!pfnDrawThemeBackground(hTheme, hdc, BP_RADIOBUTTON, RBS_CHECKEDNORMAL, &rc, NULL)) - himl = ImageList_Create(size.cx, size.cy, ILC_COLOR32|ILC_MASK, 3, 0); - } - pfnCloseThemeData(hTheme); - } - } + HTHEME hTheme = OpenThemeData(NULL, L"Button"); + SetRect(&rc, 0, 0, size.cx, size.cy); + /* unchecked */ + if (!DrawThemeBackground(hTheme, hdc, BP_RADIOBUTTON, RBS_UNCHECKEDNORMAL, &rc, NULL)) { + /* checked */ + OffsetRect(&rc, size.cx, 0); + if (!DrawThemeBackground(hTheme, hdc, BP_RADIOBUTTON, RBS_CHECKEDNORMAL, &rc, NULL)) + himl = ImageList_Create(size.cx, size.cy, ILC_COLOR32|ILC_MASK, 3, 0); } + CloseThemeData(hTheme); /* the classic way */ if (himl == NULL) { register HDC hdcMono; @@ -144,7 +127,6 @@ static HIMAGELIST CreateRadioImages(COLORREF clrBk, COLORREF clrText) ReleaseDC(NULL, hdcScreen); } - if (hUxThemeDLL!=NULL) FreeLibrary(hUxThemeDLL); return himl; } -- cgit v1.2.3