From e0e9dd5f90f4f5be48a439b310802c4b7443db0b Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 20 Sep 2013 18:40:36 +0000 Subject: using Uxtheme git-svn-id: http://svn.miranda-ng.org/main/trunk@6141 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- .../AdvancedAutoAway/AdvancedAutoAway_10.vcxproj | 4 ++++ .../AdvancedAutoAway/AdvancedAutoAway_11.vcxproj | 4 ++++ plugins/StatusPlugins/AdvancedAutoAway/options.cpp | 26 +++------------------- .../StatusPlugins/KeepStatus/KeepStatus_10.vcxproj | 8 +++---- .../StatusPlugins/KeepStatus/KeepStatus_11.vcxproj | 8 +++---- plugins/StatusPlugins/KeepStatus/options.cpp | 24 +++----------------- 6 files changed, 22 insertions(+), 52 deletions(-) (limited to 'plugins/StatusPlugins') diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj index 7d2848e789..1b5fc0bf76 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj +++ b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj @@ -94,6 +94,7 @@ 0x11bd0000 false $(ProfileDir)..\..\..\bin10\lib + UxTheme.lib;%(AdditionalDependencies) @@ -127,6 +128,7 @@ false $(ProfileDir)..\..\..\bin10\lib /PDBALTPATH:%_PDB% + UxTheme.lib;%(AdditionalDependencies) @@ -175,6 +177,7 @@ 0x11bd0000 $(ProfileDir)..\..\..\bin10\lib /PDBALTPATH:%_PDB% + UxTheme.lib;%(AdditionalDependencies) ..\..\..\include\msapi @@ -201,6 +204,7 @@ false 0x11bd0000 $(ProfileDir)..\..\..\bin10\lib + UxTheme.lib;%(AdditionalDependencies) ..\..\..\include\msapi diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_11.vcxproj b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_11.vcxproj index 47930111c0..70ab5a61cd 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_11.vcxproj +++ b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_11.vcxproj @@ -99,6 +99,7 @@ false $(ProfileDir)..\..\..\bin11\lib false + UxTheme.lib;%(AdditionalDependencies) @@ -131,6 +132,7 @@ Windows false $(ProfileDir)..\..\..\bin11\lib + UxTheme.lib;%(AdditionalDependencies) @@ -178,6 +180,7 @@ false 0x11bd0000 $(ProfileDir)..\..\..\bin11\lib + UxTheme.lib;%(AdditionalDependencies) ..\..\..\include\msapi @@ -204,6 +207,7 @@ false 0x11bd0000 $(ProfileDir)..\..\..\bin11\lib + UxTheme.lib;%(AdditionalDependencies) ..\..\..\include\msapi diff --git a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp index 6dfb8aa72c..9c89937a0f 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp @@ -21,16 +21,6 @@ #include "../resource.h" #include -static BOOL (WINAPI *pfnEnableThemeDialogTexture)(HANDLE, DWORD) = 0; - -// Thanks to TioDuke for cleaning up the ListView handling -#ifndef ListView_GetCheckState -#define ListView_GetCheckState(w,i) ((((UINT)(SNDMSG((w),LVM_GETITEMSTATE,(WPARAM)(i),LVIS_STATEIMAGEMASK)))>>12)-1) -#endif -#ifndef ListView_SetCheckState -#define ListView_SetCheckState(w,i,f) ListView_SetItemState(w,i,INDEXTOSTATEIMAGEMASK((f)+1),LVIS_STATEIMAGEMASK) -#endif - int LoadAutoAwaySetting(TAAAProtoSetting& autoAwaySetting, char* protoName); INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); @@ -452,8 +442,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayTabs(HWND hwndDlg, UINT msg, WPARAM wPara tci.mask = TCIF_TEXT|TCIF_PARAM; tci.pszText = TranslateT("General"); hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_GENAUTOAWAY), hwndDlg, DlgProcAutoAwayGeneralOpts, (LPARAM)GetParent(hwndDlg)); - if (pfnEnableThemeDialogTexture) - pfnEnableThemeDialogTexture(hPage, ETDT_ENABLETAB); + EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); tci.lParam = (LPARAM)hPage; GetClientRect(hPage, &rcPage); @@ -465,8 +454,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayTabs(HWND hwndDlg, UINT msg, WPARAM wPara tci.mask = TCIF_TEXT|TCIF_PARAM; tci.pszText = TranslateT("Rules"); hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_AUTOAWAY), hwndDlg, DlgProcAutoAwayRulesOpts, (LPARAM)GetParent(hwndDlg)); - if (pfnEnableThemeDialogTexture) - pfnEnableThemeDialogTexture(hPage, ETDT_ENABLETAB); + EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); tci.lParam = (LPARAM)hPage; GetClientRect(hPage, &rcPage); @@ -477,8 +465,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayTabs(HWND hwndDlg, UINT msg, WPARAM wPara tci.mask = TCIF_TEXT|TCIF_PARAM; tci.pszText = TranslateT("Status Messages"); hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_AUTOAWAYMSG), hwndDlg, DlgProcAutoAwayMsgOpts, (LPARAM)GetParent(hwndDlg)); - if (pfnEnableThemeDialogTexture) - pfnEnableThemeDialogTexture(hPage, ETDT_ENABLETAB); + EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); tci.lParam = (LPARAM)hPage; GetClientRect(hPage, &rcPage); @@ -533,13 +520,6 @@ static INT_PTR CALLBACK DlgProcAutoAwayTabs(HWND hwndDlg, UINT msg, WPARAM wPara int AutoAwayOptInitialise(WPARAM wParam,LPARAM lParam) { - HMODULE hUxTheme = NULL; - if(IsWinVerXPPlus()) { - hUxTheme = GetModuleHandle(_T("uxtheme.dll")); - if (hUxTheme) - pfnEnableThemeDialogTexture = (BOOL (WINAPI *)(HANDLE, DWORD))GetProcAddress(hUxTheme, "EnableThemeDialogTexture"); - } - OPTIONSDIALOGPAGE odp = { 0 }; odp.cbSize = sizeof(odp); odp.position = 1000000000; diff --git a/plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj b/plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj index 39d256af02..0ae73ed1d0 100644 --- a/plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj +++ b/plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj @@ -88,7 +88,7 @@ ..\..\..\include\msapi - ws2_32.lib;wininet.lib;%(AdditionalDependencies) + ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies) true false $(IntDir)$(TargetName).lib @@ -120,7 +120,7 @@ ..\..\..\include\msapi - ws2_32.lib;wininet.lib;%(AdditionalDependencies) + ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies) true true true @@ -155,7 +155,7 @@ true - ws2_32.lib;wininet.lib;%(AdditionalDependencies) + ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies) true $(IntDir)$(TargetName).lib Windows @@ -183,7 +183,7 @@ false - ws2_32.lib;wininet.lib;%(AdditionalDependencies) + ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies) true $(IntDir)$(TargetName).lib Windows diff --git a/plugins/StatusPlugins/KeepStatus/KeepStatus_11.vcxproj b/plugins/StatusPlugins/KeepStatus/KeepStatus_11.vcxproj index 1a1519b540..bd4aa6fec1 100644 --- a/plugins/StatusPlugins/KeepStatus/KeepStatus_11.vcxproj +++ b/plugins/StatusPlugins/KeepStatus/KeepStatus_11.vcxproj @@ -92,7 +92,7 @@ ..\..\..\include\msapi - ws2_32.lib;wininet.lib;%(AdditionalDependencies) + ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies) true false $(IntDir)$(TargetName).lib @@ -125,7 +125,7 @@ ..\..\..\include\msapi - ws2_32.lib;wininet.lib;%(AdditionalDependencies) + ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies) true true true @@ -159,7 +159,7 @@ true - ws2_32.lib;wininet.lib;%(AdditionalDependencies) + ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies) true $(IntDir)$(TargetName).lib Windows @@ -186,7 +186,7 @@ false - ws2_32.lib;wininet.lib;%(AdditionalDependencies) + ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies) true $(IntDir)$(TargetName).lib Windows diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp index 949534c71b..5af3bc584f 100644 --- a/plugins/StatusPlugins/KeepStatus/options.cpp +++ b/plugins/StatusPlugins/KeepStatus/options.cpp @@ -20,16 +20,6 @@ #include "keepstatus.h" #include "../resource.h" -static BOOL (WINAPI *pfnEnableThemeDialogTexture)(HANDLE, DWORD) = 0; - -// Thanks to TioDuke for cleaning up the ListView handling -#ifndef ListView_GetCheckState -#define ListView_GetCheckState(w,i) ((((UINT)(SNDMSG((w),LVM_GETITEMSTATE,(WPARAM)(i),LVIS_STATEIMAGEMASK)))>>12)-1) -#endif -#ifndef ListView_SetCheckState -#define ListView_SetCheckState(w,i,f) ListView_SetItemState(w,i,INDEXTOSTATEIMAGEMASK((f)+1),LVIS_STATEIMAGEMASK) -#endif - // prototypes INT_PTR CALLBACK OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam); INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam); @@ -292,8 +282,7 @@ static INT_PTR CALLBACK DlgProcKsTabs(HWND hwndDlg, UINT msg, WPARAM wParam, LPA tci.mask = TCIF_TEXT|TCIF_PARAM; tci.pszText = TranslateT("Basic"); hShow = hBasicTab = hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_KS_BASIC), hwndDlg, DlgProcKSBasicOpts, (LPARAM)GetParent(hwndDlg)); - if (pfnEnableThemeDialogTexture) - pfnEnableThemeDialogTexture(hPage, ETDT_ENABLETAB); + EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); tci.lParam = (LPARAM)hPage; GetClientRect(hPage, &rcPage); @@ -305,9 +294,8 @@ static INT_PTR CALLBACK DlgProcKsTabs(HWND hwndDlg, UINT msg, WPARAM wParam, LPA tci.mask = TCIF_TEXT|TCIF_PARAM; tci.pszText = TranslateT("Advanced"); hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_KS_ADV), hwndDlg, DlgProcKSAdvOpts, (LPARAM)GetParent(hwndDlg)); - if (pfnEnableThemeDialogTexture) { - pfnEnableThemeDialogTexture(hPage, ETDT_ENABLETAB); - } + EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); + tci.lParam = (LPARAM)hPage; GetClientRect(hPage, &rcPage); MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right-rcTabs.left)-(rcPage.right-rcPage.left))/2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom-rcTabs.top)-(rcPage.bottom-rcPage.top))/2, rcPage.right-rcPage.left, rcPage.bottom-rcPage.top, TRUE); @@ -577,12 +565,6 @@ INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar int OptionsInit(WPARAM wparam,LPARAM lparam) { - if ( IsWinVerXPPlus()) { - HMODULE hUxTheme = GetModuleHandle(_T("uxtheme.dll")); - if (hUxTheme) - pfnEnableThemeDialogTexture = (BOOL (WINAPI *)(HANDLE, DWORD))GetProcAddress(hUxTheme, "EnableThemeDialogTexture"); - } - OPTIONSDIALOGPAGE odp = { 0 }; odp.cbSize = sizeof(odp); odp.hInstance = hInst; -- cgit v1.2.3