diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-21 13:43:29 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-21 13:43:29 +0000 |
commit | a6359218bf2588d71c41a9dac62f62d6a36aea30 (patch) | |
tree | 787091b58eb36310aba34f88fe77fb5f77c8186a /protocols/AimOscar | |
parent | c69a9c892f52056d452ad8520e6c09b6956f30e3 (diff) |
using Uxtheme in protocols
git-svn-id: http://svn.miranda-ng.org/main/trunk@6156 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/AimOscar')
-rw-r--r-- | protocols/AimOscar/aim_10.vcxproj | 16 | ||||
-rw-r--r-- | protocols/AimOscar/aim_11.vcxproj | 8 | ||||
-rw-r--r-- | protocols/AimOscar/src/aim.cpp | 1 | ||||
-rw-r--r-- | protocols/AimOscar/src/aim.h | 1 | ||||
-rw-r--r-- | protocols/AimOscar/src/theme.cpp | 23 | ||||
-rw-r--r-- | protocols/AimOscar/src/theme.h | 6 | ||||
-rw-r--r-- | protocols/AimOscar/src/ui.cpp | 9 |
7 files changed, 16 insertions, 48 deletions
diff --git a/protocols/AimOscar/aim_10.vcxproj b/protocols/AimOscar/aim_10.vcxproj index 930d0b758f..c9c95a6cde 100644 --- a/protocols/AimOscar/aim_10.vcxproj +++ b/protocols/AimOscar/aim_10.vcxproj @@ -73,7 +73,7 @@ <ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;AIM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
@@ -88,7 +88,7 @@ <AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
@@ -100,7 +100,7 @@ <ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;AIM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
@@ -117,7 +117,7 @@ <GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
</Link>
@@ -128,7 +128,7 @@ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;AIM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -144,7 +144,7 @@ <AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -161,7 +161,7 @@ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;AIM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -177,7 +177,7 @@ <AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
diff --git a/protocols/AimOscar/aim_11.vcxproj b/protocols/AimOscar/aim_11.vcxproj index f5bd561c6c..2310f073c1 100644 --- a/protocols/AimOscar/aim_11.vcxproj +++ b/protocols/AimOscar/aim_11.vcxproj @@ -92,7 +92,7 @@ <AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
@@ -122,7 +122,7 @@ <GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
</Link>
@@ -149,7 +149,7 @@ <AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -181,7 +181,7 @@ <AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
diff --git a/protocols/AimOscar/src/aim.cpp b/protocols/AimOscar/src/aim.cpp index 27f991e5a9..81df8ff453 100644 --- a/protocols/AimOscar/src/aim.cpp +++ b/protocols/AimOscar/src/aim.cpp @@ -112,7 +112,6 @@ extern "C" int __declspec(dllexport) Load(void) pd.fnUninit = protoUninit;
CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM) & pd);
- InitThemeSupport();
InitIcons();
return 0;
diff --git a/protocols/AimOscar/src/aim.h b/protocols/AimOscar/src/aim.h index c05129e385..ddf2d6d60c 100644 --- a/protocols/AimOscar/src/aim.h +++ b/protocols/AimOscar/src/aim.h @@ -27,6 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <sys/stat.h>
#include <time.h>
#include <malloc.h>
+#include <Uxtheme.h>
//Miranda NG includes
#include <msapi\vssym32.h>
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp index 14a97d7f81..0a553f1d55 100644 --- a/protocols/AimOscar/src/theme.cpp +++ b/protocols/AimOscar/src/theme.cpp @@ -175,29 +175,6 @@ void InitExtraIcons(void) }
/////////////////////////////////////////////////////////////////////////////////////////
-// Themes
-
-#define MGPROC(x) GetProcAddress(themeAPIHandle,x)
-
-HMODULE themeAPIHandle = NULL; // handle to uxtheme.dll
-HANDLE (WINAPI *MyOpenThemeData)(HWND,LPCWSTR) = 0;
-HRESULT (WINAPI *MyCloseThemeData)(HANDLE) = 0;
-HRESULT (WINAPI *MyDrawThemeBackground)(HANDLE,HDC,int,int,const RECT *,const RECT *) = 0;
-
-void InitThemeSupport(void)
-{
- if (!IsWinVerXPPlus()) return;
-
- 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");
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
// OnPreBuildContactMenu
int CAimProto::OnPreBuildContactMenu(WPARAM wParam,LPARAM /*lParam*/)
diff --git a/protocols/AimOscar/src/theme.h b/protocols/AimOscar/src/theme.h index 09566479ad..8c520ceb75 100644 --- a/protocols/AimOscar/src/theme.h +++ b/protocols/AimOscar/src/theme.h @@ -19,12 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #ifndef THEME_H
#define THEME_H
-extern HMODULE themeAPIHandle;
-extern HANDLE (WINAPI *MyOpenThemeData)(HWND,LPCWSTR);
-extern HRESULT (WINAPI *MyCloseThemeData)(HANDLE);
-extern HRESULT (WINAPI *MyDrawThemeBackground)(HANDLE,HDC,int,int,const RECT *,const RECT *);
-
-void InitThemeSupport(void);
void InitIcons(void);
void InitExtraIcons(void);
diff --git a/protocols/AimOscar/src/ui.cpp b/protocols/AimOscar/src/ui.cpp index 9c165eb7b5..9e5a82cab0 100644 --- a/protocols/AimOscar/src/ui.cpp +++ b/protocols/AimOscar/src/ui.cpp @@ -47,7 +47,7 @@ void DrawMyControl(HDC hDC, HWND /*hwndButton*/, HANDLE hTheme, UINT iState, REC }
rect.top-=1;
rect.left-=1;
- MyDrawThemeBackground(hTheme, hDC, BP_PUSHBUTTON,state, &rect, NULL);
+ DrawThemeBackground(hTheme, hDC, BP_PUSHBUTTON,state, &rect, NULL);
}
else
{
@@ -219,11 +219,8 @@ static INT_PTR CALLBACK userinfo_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_DRAWITEM:
{
- if (themeAPIHandle)
- {
- MyCloseThemeData (hThemeButton);
- hThemeButton = MyOpenThemeData (GetDlgItem(hwndDlg, IDC_BOLD), L"Button");
- }
+ CloseThemeData(hThemeButton);
+ hThemeButton = OpenThemeData(GetDlgItem(hwndDlg, IDC_BOLD), L"Button");
LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT) lParam;
if (lpDIS->CtlID == IDC_SUPERSCRIPT)
{
|