summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-09-20 09:35:35 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-09-20 09:35:35 +0000
commit4e2b9eef0d9a530b633c69cfa03ee43359c3a213 (patch)
tree8e9589e65c2c34ce9bebe01bbc55dbc54a44bf2d
parentb67ee96b01cb9bc3c2d01e7f8441311ffbc20687 (diff)
using Uxtheme
git-svn-id: http://svn.miranda-ng.org/main/trunk@6136 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Clist_blind/Clist_blind_10.vcxproj10
-rw-r--r--plugins/Clist_blind/Clist_blind_11.vcxproj8
-rw-r--r--plugins/Clist_blind/src/clcpaint.cpp36
-rw-r--r--plugins/Clist_blind/src/commonheaders.h1
4 files changed, 13 insertions, 42 deletions
diff --git a/plugins/Clist_blind/Clist_blind_10.vcxproj b/plugins/Clist_blind/Clist_blind_10.vcxproj
index a69e0b9e94..80e977f52e 100644
--- a/plugins/Clist_blind/Clist_blind_10.vcxproj
+++ b/plugins/Clist_blind/Clist_blind_10.vcxproj
@@ -20,7 +20,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>Clist_blind</ProjectName>
- <ProjectGuid>{A6A38A40-56AD-48A0-8FB3-3B4B59FF4C5D}</ProjectGuid>
+ <ProjectGuid>{2E15C462-A150-4A37-ACD6-FBAECF1724F5}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -93,7 +93,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
</Link>
@@ -122,7 +122,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
</Link>
@@ -152,7 +152,7 @@
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -177,7 +177,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
diff --git a/plugins/Clist_blind/Clist_blind_11.vcxproj b/plugins/Clist_blind/Clist_blind_11.vcxproj
index 9ab5f1c268..cddaf4719d 100644
--- a/plugins/Clist_blind/Clist_blind_11.vcxproj
+++ b/plugins/Clist_blind/Clist_blind_11.vcxproj
@@ -97,7 +97,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
@@ -125,7 +125,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
@@ -154,7 +154,7 @@
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
@@ -180,7 +180,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
diff --git a/plugins/Clist_blind/src/clcpaint.cpp b/plugins/Clist_blind/src/clcpaint.cpp
index a8bff07803..f9d2094c61 100644
--- a/plugins/Clist_blind/src/clcpaint.cpp
+++ b/plugins/Clist_blind/src/clcpaint.cpp
@@ -138,12 +138,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 PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
{
HDC hdcMem;
@@ -350,37 +344,13 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
//checkboxes
if (checkboxWidth) {
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;
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, group->cl.items[group->scanIndex]->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 | (group->cl.items[group->scanIndex]->flags & CONTACTF_CHECKED ? DFCS_CHECKED : 0) | (hottrack ? DFCS_HOT : 0));
-
- if (hTheme && MyCloseThemeData) {
- MyCloseThemeData(hTheme);
- hTheme = NULL;
- }
+ DrawThemeBackground(hTheme, hdcMem, BP_CHECKBOX, group->cl.items[group->scanIndex]->flags & CONTACTF_CHECKED ? (hottrack ? CBS_CHECKEDHOT : CBS_CHECKEDNORMAL) : (hottrack ? CBS_UNCHECKEDHOT : CBS_UNCHECKEDNORMAL), &rc, &rc);
+ CloseThemeData(hTheme);
}
//icon
diff --git a/plugins/Clist_blind/src/commonheaders.h b/plugins/Clist_blind/src/commonheaders.h
index 0dbece6987..d95d9ffa80 100644
--- a/plugins/Clist_blind/src/commonheaders.h
+++ b/plugins/Clist_blind/src/commonheaders.h
@@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <windows.h>
#include <vssym32.h>
+#include <Uxtheme.h>
#include <newpluginapi.h>
#include <m_clistint.h>