diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-20 18:40:36 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-20 18:40:36 +0000 |
commit | e0e9dd5f90f4f5be48a439b310802c4b7443db0b (patch) | |
tree | 2cf27bc13212a3b30e5ba3b051429e6d326c9f4e /plugins/UserInfoEx/src | |
parent | db3809c5db0a3a1bf82ecd59a5523e8831c207dd (diff) |
using Uxtheme
git-svn-id: http://svn.miranda-ng.org/main/trunk@6141 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/src')
-rw-r--r-- | plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp | 9 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/commonheaders.h | 1 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/ctrl_button.cpp | 55 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/dlg_propsheet.cpp | 4 |
4 files changed, 7 insertions, 62 deletions
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp index c18583930d..0e82631427 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp @@ -302,14 +302,7 @@ void InitIcons() if (NULL == (dib = LoadResource(IDB_FLAGSPNG,_T("PNG"))))
return;
- if (IsWinVerXPPlus()) bitDest = bit = ILC_COLOR32;
- else if (IsWinVer2000Plus()) bitDest = ILC_COLOR24;
- else if (IsWinVerMEPlus()) bitDest = ILC_COLOR16;
- /*else preset bitDest = ILC_COLOR8;*/
-
- //we work always with 24bit if bitDest < xp+
- //coz we cannot perform paste operations between palettized images,
- //unless both src and dst images use the same palette.
+ bitDest = bit = ILC_COLOR32;
if (FIP->FI_GetBPP(dib) != bit)
if (NULL == (dib = ConvertTo(dib, bit, 0))) return;
diff --git a/plugins/UserInfoEx/src/commonheaders.h b/plugins/UserInfoEx/src/commonheaders.h index 85cc866c83..d5e67ba2f5 100644 --- a/plugins/UserInfoEx/src/commonheaders.h +++ b/plugins/UserInfoEx/src/commonheaders.h @@ -44,6 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <Richedit.h>
#include <dlgs.h>
#include <assert.h>
+#include <UxTheme.h>
#include <string>
using namespace std;
diff --git a/plugins/UserInfoEx/src/ctrl_button.cpp b/plugins/UserInfoEx/src/ctrl_button.cpp index fd29e29f4c..b0ada2b385 100644 --- a/plugins/UserInfoEx/src/ctrl_button.cpp +++ b/plugins/UserInfoEx/src/ctrl_button.cpp @@ -25,8 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define BUTTON_POLLID 100
#define BUTTON_POLLDELAY 50
-#define MGPROC(x) GetProcAddress(themeAPIHandle,x)
-
typedef struct TMBCtrl{
HWND hwnd;
HANDLE hThemeButton;
@@ -49,51 +47,6 @@ typedef struct TMBCtrl{ // External theme methods and properties
static CRITICAL_SECTION csTips;
static HWND hwndToolTips = NULL;
-static HMODULE themeAPIHandle = NULL;
-
-// theme procedures
-static HANDLE (WINAPI *OpenThemeData)(HWND,LPCWSTR);
-static HRESULT (WINAPI *CloseThemeData)(HANDLE);
-static BOOL (WINAPI *IsThemeBackgroundPartiallyTransparent)(HANDLE,int,int);
-static HRESULT (WINAPI *DrawThemeParentBackground)(HWND,HDC,RECT *);
-static HRESULT (WINAPI *DrawThemeBackground)(HANDLE,HDC,int,int,const RECT *,const RECT *);
-static HRESULT (WINAPI *DrawThemeText)(HANDLE,HDC,int,int,LPCWSTR,int,DWORD,DWORD,const RECT *);
-static HRESULT (WINAPI *GetThemeTextExtent)(HANDLE,HDC,int,int,LPCWSTR,int,DWORD,OPTIONAL const RECT*, RECT *);
-
-/**
- * name: ThemeSupport
- * desc: Loads the uxtheme functions, if supported by the os
- * param: none
- * return: TRUE if themes are supported, FALSE if not
- **/
-static BYTE __fastcall ThemeSupport() {
- if (IsWinVerXPPlus()) {
- if (!themeAPIHandle) {
- themeAPIHandle = GetModuleHandleA("uxtheme");
- if (themeAPIHandle) {
- OpenThemeData = (HANDLE (WINAPI *)(HWND,LPCWSTR))MGPROC("OpenThemeData");
- CloseThemeData = (HRESULT (WINAPI *)(HANDLE))MGPROC("CloseThemeData");
- IsThemeBackgroundPartiallyTransparent = (BOOL (WINAPI *)(HANDLE,int,int))MGPROC("IsThemeBackgroundPartiallyTransparent");
- DrawThemeParentBackground = (HRESULT (WINAPI *)(HWND,HDC,RECT *))MGPROC("DrawThemeParentBackground");
- DrawThemeBackground = (HRESULT (WINAPI *)(HANDLE,HDC,int,int,const RECT *,const RECT *))MGPROC("DrawThemeBackground");
- DrawThemeText = (HRESULT (WINAPI *)(HANDLE,HDC,int,int,LPCWSTR,int,DWORD,DWORD,const RECT *))MGPROC("DrawThemeText");
- GetThemeTextExtent = (HRESULT (WINAPI *)(HANDLE,HDC,int,int,LPCWSTR,int,DWORD,OPTIONAL const RECT*, RECT *))MGPROC("GetThemeTextExtent");
- }
- }
- // Make sure all of these methods are valid (i would hope either all or none work)
- if (OpenThemeData
- && CloseThemeData
- && IsThemeBackgroundPartiallyTransparent
- && DrawThemeParentBackground
- && DrawThemeBackground
- && DrawThemeText
- && GetThemeTextExtent)
- {
- return TRUE;
- }
- }
- return FALSE;
-}
/**
* name: DestroyTheme
@@ -119,11 +72,9 @@ static void __fastcall DestroyTheme(BTNCTRL *ctl) { * return: nothing
**/
static void __fastcall LoadTheme(BTNCTRL *ctl) {
- if (ThemeSupport()) {
- DestroyTheme(ctl);
- ctl->hThemeButton = OpenThemeData(ctl->hwnd,L"BUTTON");
- ctl->hThemeToolbar = OpenThemeData(ctl->hwnd,L"TOOLBAR");
- }
+ DestroyTheme(ctl);
+ ctl->hThemeButton = OpenThemeData(ctl->hwnd,L"BUTTON");
+ ctl->hThemeToolbar = OpenThemeData(ctl->hwnd,L"TOOLBAR");
}
/**
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 2775719a87..3582c99a10 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -284,7 +284,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam) // create imagelist
metrics.x = GetSystemMetrics(SM_CXSMICON);
metrics.y = GetSystemMetrics(SM_CYSMICON);
- if ((psh._hImages = ImageList_Create(metrics.x, metrics.y, (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16) | ILC_MASK, 0, 1)) == NULL) {
+ if ((psh._hImages = ImageList_Create(metrics.x, metrics.y, ILC_COLOR32 | ILC_MASK, 0, 1)) == NULL) {
MsgErr(NULL, LPGENT("Creating the imagelist failed!"));
return 1;
}
@@ -585,7 +585,7 @@ void DlgContactInfoInitTreeIcons() metrics.x = GetSystemMetrics(SM_CXSMICON);
metrics.y = GetSystemMetrics(SM_CYSMICON);
- if (psh._hImages = ImageList_Create(metrics.x, metrics.y, (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16) | ILC_MASK, 0, 1)) {
+ if (psh._hImages = ImageList_Create(metrics.x, metrics.y, ILC_COLOR32 | ILC_MASK, 0, 1)) {
HICON hDefIcon = IcoLib_GetIcon(ICO_TREE_DEFAULT);
if (!hDefIcon)
{
|