summaryrefslogtreecommitdiff
path: root/plugins/Clist_mw
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/Clist_mw
parent4e2b9eef0d9a530b633c69cfa03ee43359c3a213 (diff)
using Uxtheme
git-svn-id: http://svn.miranda-ng.org/main/trunk@6137 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_mw')
-rw-r--r--plugins/Clist_mw/clist_mw_10.vcxproj8
-rw-r--r--plugins/Clist_mw/clist_mw_11.vcxproj8
-rw-r--r--plugins/Clist_mw/src/clcpaint.cpp37
-rw-r--r--plugins/Clist_mw/src/commonheaders.h1
4 files changed, 13 insertions, 41 deletions
diff --git a/plugins/Clist_mw/clist_mw_10.vcxproj b/plugins/Clist_mw/clist_mw_10.vcxproj
index c9c75c0066..c15757ac30 100644
--- a/plugins/Clist_mw/clist_mw_10.vcxproj
+++ b/plugins/Clist_mw/clist_mw_10.vcxproj
@@ -89,7 +89,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x6590000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -118,7 +118,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x6590000</BaseAddress>
@@ -149,7 +149,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
@@ -183,7 +183,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
diff --git a/plugins/Clist_mw/clist_mw_11.vcxproj b/plugins/Clist_mw/clist_mw_11.vcxproj
index 60e979e3e7..6f33fd2410 100644
--- a/plugins/Clist_mw/clist_mw_11.vcxproj
+++ b/plugins/Clist_mw/clist_mw_11.vcxproj
@@ -93,7 +93,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x6590000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -123,7 +123,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x6590000</BaseAddress>
@@ -154,7 +154,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
@@ -187,7 +187,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
diff --git a/plugins/Clist_mw/src/clcpaint.cpp b/plugins/Clist_mw/src/clcpaint.cpp
index f34c98e8ac..b08e989b06 100644
--- a/plugins/Clist_mw/src/clcpaint.cpp
+++ b/plugins/Clist_mw/src/clcpaint.cpp
@@ -135,12 +135,6 @@ static int GetRealStatus(struct ClcContact * contact, int status)
return status;
}
-static HMODULE themeAPIHandle = NULL; // handle to uxtheme.dll
-static HANDLE (WINAPI *MyOpenThemeData)(HWND,LPCWSTR);
-static HRESULT (WINAPI *MyCloseThemeData)(HANDLE);
-static HRESULT (WINAPI *MyDrawThemeBackground)(HANDLE,HDC,int,int,const RECT *,const RECT *);
-
-#define MGPROC(x) GetProcAddress(themeAPIHandle,x)
void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint)
{
HDC hdcMem;
@@ -381,37 +375,14 @@ void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint)
//checkboxes
if (checkboxWidth && (subindex == -1 ||1)) {
RECT rc;
- HANDLE hTheme = NULL;
-
- // THEME
- if (IsWinVerXPPlus()) {
- if ( !themeAPIHandle) {
- themeAPIHandle = GetModuleHandleA("uxtheme");
- if (themeAPIHandle) {
- MyOpenThemeData = (HANDLE (WINAPI *)(HWND,LPCWSTR))MGPROC("OpenThemeData");
- MyCloseThemeData = (HRESULT (WINAPI *)(HANDLE))MGPROC("CloseThemeData");
- MyDrawThemeBackground = (HRESULT (WINAPI *)(HANDLE,HDC,int,int,const RECT *,const RECT *))MGPROC("DrawThemeBackground");
- }
- }
- // Make sure all of these methods are valid (i would hope either all or none work)
- if (MyOpenThemeData
- &&MyCloseThemeData
- &&MyDrawThemeBackground) {
- hTheme = MyOpenThemeData(hwnd,L"BUTTON");
- }
- }
+ HANDLE hTheme = OpenThemeData(hwnd,L"BUTTON");
+
rc.left = dat->leftMargin+indent*dat->groupIndent+subident;
rc.right = rc.left+dat->checkboxSize;
rc.top = y+((dat->rowHeight-dat->checkboxSize)>>1);
rc.bottom = rc.top+dat->checkboxSize;
- if (hTheme) {
- MyDrawThemeBackground(hTheme, hdcMem, BP_CHECKBOX, Drawing->flags&CONTACTF_CHECKED?(hottrack?CBS_CHECKEDHOT:CBS_CHECKEDNORMAL):(hottrack?CBS_UNCHECKEDHOT:CBS_UNCHECKEDNORMAL), &rc, &rc);
- }
- else DrawFrameControl(hdcMem,&rc,DFC_BUTTON,DFCS_BUTTONCHECK|DFCS_FLAT|(Drawing->flags&CONTACTF_CHECKED?DFCS_CHECKED:0)|(hottrack?DFCS_HOT:0));
- if (hTheme&&MyCloseThemeData) {
- MyCloseThemeData(hTheme);
- hTheme = NULL;
- }
+ DrawThemeBackground(hTheme, hdcMem, BP_CHECKBOX, Drawing->flags&CONTACTF_CHECKED?(hottrack?CBS_CHECKEDHOT:CBS_CHECKEDNORMAL):(hottrack?CBS_UNCHECKEDHOT:CBS_UNCHECKEDNORMAL), &rc, &rc);
+ CloseThemeData(hTheme);
}
//icon
diff --git a/plugins/Clist_mw/src/commonheaders.h b/plugins/Clist_mw/src/commonheaders.h
index b26ebe94a9..2aecdd67d3 100644
--- a/plugins/Clist_mw/src/commonheaders.h
+++ b/plugins/Clist_mw/src/commonheaders.h
@@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <windows.h>
#include <vssym32.h>
+#include <Uxtheme.h>
#include <malloc.h>
#include <stddef.h>