summaryrefslogtreecommitdiff
path: root/plugins/LangMan
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-09-20 12:59:56 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-09-20 12:59:56 +0000
commit61e43dca25a80a451cf2b7dbbc4931a8f2a96d80 (patch)
treef7e3b3172aac403c678a71bdfb783358609c8119 /plugins/LangMan
parent4e2b9eef0d9a530b633c69cfa03ee43359c3a213 (diff)
using Uxtheme
git-svn-id: http://svn.miranda-ng.org/main/trunk@6137 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/LangMan')
-rw-r--r--plugins/LangMan/langman_10.vcxproj8
-rw-r--r--plugins/LangMan/langman_11.vcxproj8
-rw-r--r--plugins/LangMan/src/common.h1
-rw-r--r--plugins/LangMan/src/options.cpp36
4 files changed, 18 insertions, 35 deletions
diff --git a/plugins/LangMan/langman_10.vcxproj b/plugins/LangMan/langman_10.vcxproj
index 54cd7cf6de..05fd96e8be 100644
--- a/plugins/LangMan/langman_10.vcxproj
+++ b/plugins/LangMan/langman_10.vcxproj
@@ -88,7 +88,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x24100000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -114,7 +114,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x24100000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -145,7 +145,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x24100000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -178,7 +178,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x24100000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
diff --git a/plugins/LangMan/langman_11.vcxproj b/plugins/LangMan/langman_11.vcxproj
index 0402b3ec9f..ce63787cdd 100644
--- a/plugins/LangMan/langman_11.vcxproj
+++ b/plugins/LangMan/langman_11.vcxproj
@@ -92,7 +92,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x24100000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -119,7 +119,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x24100000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -150,7 +150,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x24100000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -182,7 +182,7 @@
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x24100000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
diff --git a/plugins/LangMan/src/common.h b/plugins/LangMan/src/common.h
index cc0e8c041f..d3cd0a1397 100644
--- a/plugins/LangMan/src/common.h
+++ b/plugins/LangMan/src/common.h
@@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <windows.h>
#include <ShlObj.h>
#include <vsstyle.h>
+#include <Uxtheme.h>
#include <newpluginapi.h>
#include <m_langpack.h>
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;
}