summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown
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/AutoShutdown
parent4e2b9eef0d9a530b633c69cfa03ee43359c3a213 (diff)
using Uxtheme
git-svn-id: http://svn.miranda-ng.org/main/trunk@6137 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AutoShutdown')
-rw-r--r--plugins/AutoShutdown/shutdown_10.vcxproj13
-rw-r--r--plugins/AutoShutdown/shutdown_11.vcxproj8
-rw-r--r--plugins/AutoShutdown/src/common.h1
-rw-r--r--plugins/AutoShutdown/src/frame.cpp15
4 files changed, 12 insertions, 25 deletions
diff --git a/plugins/AutoShutdown/shutdown_10.vcxproj b/plugins/AutoShutdown/shutdown_10.vcxproj
index 6a1772d787..1c9a7e9cb2 100644
--- a/plugins/AutoShutdown/shutdown_10.vcxproj
+++ b/plugins/AutoShutdown/shutdown_10.vcxproj
@@ -94,7 +94,7 @@
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<BaseAddress>0x11070000</BaseAddress>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
</Link>
@@ -122,7 +122,7 @@
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<BaseAddress>0x11070000</BaseAddress>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
</Link>
@@ -155,7 +155,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
@@ -183,7 +183,7 @@
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<BaseAddress>0x11070000</BaseAddress>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -220,11 +220,6 @@
<ResourceCompile Include="res\resource.rc" />
<ResourceCompile Include="res\version.rc" />
</ItemGroup>
- <ItemGroup>
- <None Include="res\active.ico" />
- <None Include="res\header.ico" />
- <None Include="res\inactive.ico" />
- </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
diff --git a/plugins/AutoShutdown/shutdown_11.vcxproj b/plugins/AutoShutdown/shutdown_11.vcxproj
index 34bcb3d692..aeef88602a 100644
--- a/plugins/AutoShutdown/shutdown_11.vcxproj
+++ b/plugins/AutoShutdown/shutdown_11.vcxproj
@@ -98,7 +98,7 @@
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<BaseAddress>0x11070000</BaseAddress>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
@@ -127,7 +127,7 @@
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<BaseAddress>0x11070000</BaseAddress>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
</Link>
@@ -160,7 +160,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -187,7 +187,7 @@
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<BaseAddress>0x11070000</BaseAddress>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
diff --git a/plugins/AutoShutdown/src/common.h b/plugins/AutoShutdown/src/common.h
index fba4f10304..8752f1d0aa 100644
--- a/plugins/AutoShutdown/src/common.h
+++ b/plugins/AutoShutdown/src/common.h
@@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <time.h> /* for mktime(),time() */
#include <windows.h>
+#include <Uxtheme.h>
/* WinXP+: shutdown reason codes */
#if defined(EWX_RESTARTAPPS) /* new MS Platform SDK */
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp
index 30c356812e..3e8262d7fa 100644
--- a/plugins/AutoShutdown/src/frame.cpp
+++ b/plugins/AutoShutdown/src/frame.cpp
@@ -588,25 +588,16 @@ static int FrameModulesLoaded(WPARAM wParam,LPARAM lParam)
{
if(ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
LOGFONT lf;
- COLORREF clr;
- HMODULE hUxThemeDLL;
- BOOL (WINAPI *pfnIsThemeActive)(VOID);
/* built-in font module is not available before this hook */
- clr=GetDefaultColor(FRAMEELEMENT_TEXT);
+ COLORREF clr = GetDefaultColor(FRAMEELEMENT_TEXT);
FontService_RegisterFont("AutoShutdown","CountdownFont",LPGENT("Automatic Shutdown"),LPGENT("Countdown on Frame"),LPGENT("Automatic Shutdown"),LPGENT("Background"),0,FALSE,GetDefaultFont(&lf),clr);
clr=GetDefaultColor(FRAMEELEMENT_BKGRND);
FontService_RegisterColor("AutoShutdown","BkgColor",LPGENT("Automatic Shutdown"),LPGENT("Background"),clr);
- /* progressbar color can only be changed in windows classic theme */
- /* FIXME: should be registered/unregistered on WM_THEMECHANGED/ME_OPT_INITIALISE msg,
- * currently not possible as no such font service exists */
- hUxThemeDLL=LoadLibraryA("UXTHEME"); /* all ascii */
- *(PROC*)&pfnIsThemeActive=(hUxThemeDLL!=NULL)?GetProcAddress(hUxThemeDLL,"IsThemeActive"):NULL;
- if(pfnIsThemeActive==NULL || !pfnIsThemeActive()) {
+ if( !IsThemeActive()) {
/* progressbar color can only be changed with classic theme */
- clr=GetDefaultColor(FRAMEELEMENT_BAR);
+ clr=GetDefaultColor(FRAMEELEMENT_BAR);
FontService_RegisterColor("AutoShutdown","ProgressColor",TranslateT("Automatic Shutdown"),TranslateT("Progress Bar"),clr);
}
- if(hUxThemeDLL!=NULL) FreeLibrary(hUxThemeDLL);
}
return 0;
}