From 9f629fac62ab3bae97a5d51875506890f286dbc7 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Fri, 11 Nov 2011 09:38:00 +0000 Subject: [PATCH] Rainmeter.dll now shares icon with Rainmeter.exe to reduce binary size. --- Application/Application.cpp | 1 - Application/Application.rc | 61 ++---------------------- Application/Application.vcxproj | 3 -- Application/Application.vcxproj.filters | 5 -- Application/resource.h | 21 -------- Library/DialogAbout.cpp | 4 +- Library/DialogManage.cpp | 2 +- Library/Library.rc | 10 ---- Library/Library.vcxproj | 4 -- Library/Library.vcxproj.filters | 8 ---- Library/Res/tray.ico | Bin 1150 -> 0 bytes Library/Res/window.ico | Bin 5430 -> 0 bytes Library/TrayWindow.cpp | 2 +- Library/resource.h | 4 +- 14 files changed, 9 insertions(+), 116 deletions(-) delete mode 100644 Application/resource.h delete mode 100644 Library/Res/tray.ico delete mode 100644 Library/Res/window.ico diff --git a/Application/Application.cpp b/Application/Application.cpp index becf0a7c..e39d787d 100644 --- a/Application/Application.cpp +++ b/Application/Application.cpp @@ -21,7 +21,6 @@ #include #include #include -#include "resource.h" #include "../Library/Rainmeter.h" #if defined _M_IX86 diff --git a/Application/Application.rc b/Application/Application.rc index 7c992dcd..3a2b0ff5 100644 --- a/Application/Application.rc +++ b/Application/Application.rc @@ -1,23 +1,9 @@ // Microsoft Developer Studio generated resource script. -// Caution! Do not modify this file without changing \install\UpdateApplicationRC.au3 -// -#include "resource.h" +// +#include +#include "../Library/resource.h" #include "../Version.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "windows.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Finnish resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT #pragma code_page(1252) @@ -72,44 +58,3 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_RAINMETER ICON DISCARDABLE "Rainmeter.ico" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // Finnish resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/Application/Application.vcxproj b/Application/Application.vcxproj index f5300d9f..6b6adec9 100644 --- a/Application/Application.vcxproj +++ b/Application/Application.vcxproj @@ -313,9 +313,6 @@ xcopy /Q /S /Y ..\Install\Default.ini ..\testbench\x32\release\ NDEBUG;%(PreprocessorDefinitions) - - - diff --git a/Application/Application.vcxproj.filters b/Application/Application.vcxproj.filters index 079efa20..ee504c01 100644 --- a/Application/Application.vcxproj.filters +++ b/Application/Application.vcxproj.filters @@ -19,11 +19,6 @@ Source Files - - - Header Files - - Resource Files diff --git a/Application/resource.h b/Application/resource.h deleted file mode 100644 index 4c05a793..00000000 --- a/Application/resource.h +++ /dev/null @@ -1,21 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by Host.rc -// -#define IDI_RAINMETER 103 -#define IDR_TRAYMENU 104 -#define ID_TRAYMENU_REFRESH 40001 -#define ID_TRAYMENU_QUIT 40002 -#define ID_TRAYMENU_SHOW 40003 -#define ID_TRAYMENU_HIDE 40010 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 105 -#define _APS_NEXT_COMMAND_VALUE 40011 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/Library/DialogAbout.cpp b/Library/DialogAbout.cpp index 3971c927..46f28a13 100644 --- a/Library/DialogAbout.cpp +++ b/Library/DialogAbout.cpp @@ -245,7 +245,7 @@ INT_PTR CALLBACK CDialogAbout::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR INT_PTR CDialogAbout::OnInitDialog(WPARAM wParam, LPARAM lParam) { - HICON hIcon = LoadIcon(Rainmeter->GetInstance(), MAKEINTRESOURCE(IDI_TRAY)); + HICON hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_RAINMETER), IMAGE_ICON, 16, 16, LR_SHARED); SendMessage(m_Window, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); if (wcscmp(GetString(ID_STR_ISRTL), L"1") == 0) @@ -1030,7 +1030,7 @@ void CDialogAbout::CTabVersion::Initialize() m_Initialized = true; HWND item = GetDlgItem(m_Window, IDC_ABOUTVERSION_RAINMETER_ICON); - HICON icon = LoadIcon(Rainmeter->GetInstance(), MAKEINTRESOURCE(IDI_WINDOW)); + HICON icon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_RAINMETER), IMAGE_ICON, 32, 32, LR_SHARED); Static_SetIcon(item, icon); item = GetDlgItem(m_Window, IDC_ABOUTVERSION_VERSION_TEXT); diff --git a/Library/DialogManage.cpp b/Library/DialogManage.cpp index 5a6e9d9a..77913c81 100644 --- a/Library/DialogManage.cpp +++ b/Library/DialogManage.cpp @@ -226,7 +226,7 @@ INT_PTR CALLBACK CDialogManage::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA INT_PTR CDialogManage::OnInitDialog(WPARAM wParam, LPARAM lParam) { - HICON hIcon = LoadIcon(Rainmeter->GetInstance(), MAKEINTRESOURCE(IDI_TRAY)); + HICON hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_RAINMETER), IMAGE_ICON, 16, 16, LR_SHARED); SendMessage(m_Window, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); if (wcscmp(GetString(ID_STR_ISRTL), L"1") == 0) diff --git a/Library/Library.rc b/Library/Library.rc index d99347bf..a2a9da39 100644 --- a/Library/Library.rc +++ b/Library/Library.rc @@ -49,13 +49,3 @@ BEGIN VALUE "Translation", 0x409, 1252 END END - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_TRAY ICON DISCARDABLE "res\\tray.ico" -IDI_WINDOW ICON DISCARDABLE "res\\window.ico" diff --git a/Library/Library.vcxproj b/Library/Library.vcxproj index eb3ea322..b59cbbf2 100644 --- a/Library/Library.vcxproj +++ b/Library/Library.vcxproj @@ -924,10 +924,6 @@ - - - - diff --git a/Library/Library.vcxproj.filters b/Library/Library.vcxproj.filters index f41e19f7..5fc2558e 100644 --- a/Library/Library.vcxproj.filters +++ b/Library/Library.vcxproj.filters @@ -597,14 +597,6 @@ Header Files - - - Resource Files - - - Resource Files - - Resource Files diff --git a/Library/Res/tray.ico b/Library/Res/tray.ico deleted file mode 100644 index e5c46e330f3430c0f29289b295088295db0e7452..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1150 zcma)(JxClu7>36furQ!0lGX%7L<_qF(#XcbA_!@;Qmh0~1hJ5qLIpt!Bi52YP6Z`q z{JYt^TUPL2F99_dMevMz;txU!iKI~w&u8$E6((zDdG4EezxSP;*%Km-Cp%m4`%Kh6 z6ym86A|H@YZgk3j4W-n}pi=Xb%KjNt_6l_kV(3-(ZGfi%?^(nSHhzzMsa$u4-p8Eb zy6MnZIr;(pum9SEUJ;(ebZERL?hbrRxPkLMH;|+zciq6kx5&sF&a;HC-Lwa19(U}? z&TV&~TjzG%{#$mLv(LstSl087xG6uO?5*YSNK0ZWaO}-8kAptX%9=CWMgE5=j~-hL z%VvBtsr+wh8)RxfcSz@(l;Qhj%5$#|Fc@=&GWOliugU4Z@y@W7s>QQ@M@%iypYsh4 z@D!T*TEjB~?|k~B?D5IeCsz*J@W|BH8od{A1i4-h>onMe4zF&SBtfum<%opK-$!pT^>ib4Pj~ys5`TR68uOJCMem=h* v*$Q~<=lPQ(t^F)%&1QHgmDb#ew4!hlmDXXewEn^w-U~P{meysPw65S9o+n8I diff --git a/Library/Res/window.ico b/Library/Res/window.ico deleted file mode 100644 index 97bd22c698ddba04f1d0834648044326192ee3c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5430 zcmcgw3s98T6~6y253O}1F~*J)iM5)ZMjl42fQs=+w6!Mc3?Oj(odq0Bw|0$8|Cw*^{qH@G zd(J)gock|h0u!+*QyAJQOzFYcD~vG@wDcb0!dL_PuVD-%Y#~77Bm9Wd)6?D7ty||F z5)$gZc=2L4$ae)qBdo_RuD<@{kXRAtTr^?A1Qr$+#^_#4mnT$JRl?7T$l~H+UQ$xRbvoU7gUNC@U#FaL@-~FaPS*-=$|rx0aWe-^TiQU|`@0D0*}9WKZVm zN}=ieL%uef&4S5fWCaDPP4GX@$jof4v|7iNDpOb1D&sDn)u!+ZmMq?8%;3#MNnCSO za_60yuO3{pZo^8fzoV$Ah|irnSFv{O`Z3OH9-uUt%nUX#_*4;4Qi|zUYto@2+3 zr3Et#`AEXwg# z*+EvNjAzI565Olu5;sRj?V4jUnY#Dx-P?wo`Be7T)}9cmt8Em61(atdy)^kRm#ld^ z;s0LjF|DEJbYX%SI_EVSt|Kl=IkZK67nl9J+-?`Z{;e^e?Ja)9MU;JGvu` zWq=k~8+-+fbMr$>Gi0A{sXpN9?qOiN3@vt-GVmjj`V7GrrDttxf#RXv5+1Xpr!uMNK5XY>eqr++2NgndJ zz2+eIv7DS-FZiQx_wL=DnDQGnYBcT|9*@Z*f1w5;UbKS6Vs?k_3#b>})22=LLLNqa z4t|V&Xw6S*i;GL(10(95fgz8WsrJmCJv-Ig+sAGG{C6K?#W|(*im6t>_8`jFSg-2F zjT@|?p@Hq#vEwm%XI>D;46!GalxV5;`BH6@NF+DF>pyAIBsO~VXuBASQ`&Rr7IZrO zD5{O9nGdHX|JUl!+zNx8+H8(ell9N-ONjEXq)KpV!Q9i;x=%*nj?%}R=A5)=-Yl;n#TCJK2 znjdg4>r6;Um~!MuoPfO-Qd85OSw9Jo%axQ5#1$1~bRXG+ec-rzH_pHl85xPO0<~6K z!dI_e{W;wo5D%h|kdP74O+s*|f_@X7ZQKQ|KSPXNp}K%Gu0hxTaB*g))E=(^0f8f` zn}kvPB_^gao2^n*Q)6RAMa5=}aRT;QfjbVXtE&@k-@ZNKx`za+)rIzapwSfJ%oR?@ zow!#jmHrEH=ecj+SIBcapE}PD$#%BYXbLGWiYV8jzDCB!$A3(=H#Rm1ad9KN=Z@B- z*K1jQ{b?qXZ%F*(R7HM^zF@G7>a~yQL9Ld0% zH6~qgbel!CpZIW>e}s$ZL(VtV22~hzv^wH1((2BiFyw#PQ7XMYoEQC8fY$SMgGmts z{zgaq7;maEsJ;N5b&&rSS_xqPPK6C(_+&Zg90oM(IsjxhndI)5Et!7cd-2D5@XZ(k znlnEhr+1A15rXaj!!1pYagzXnVjPJ?&)zo7-# zGkn}pA2i8;e)t^THv+^zZuq#PK4@M6?g0KYk9Gn;YYK2g?`RCPp97}{`TvT34e;oH zDn~rS$3RQ=)&lfg0A3$H?@S*&J^%*}Iz#V>2D~2v&pDbK8oT?l%J=d(m2ai{Ff3B} jR^3$j)&e(cRlZmMrt-Z9d=J`gplgB3w^yR_?Far19m}_W diff --git a/Library/TrayWindow.cpp b/Library/TrayWindow.cpp index d1d8fd7b..3e767ec8 100644 --- a/Library/TrayWindow.cpp +++ b/Library/TrayWindow.cpp @@ -264,7 +264,7 @@ HICON CTrayWindow::CreateTrayIcon(double value) } // Return the default icon if there is no valid measure - return LoadIcon(m_Instance, MAKEINTRESOURCE(IDI_TRAY)); + return (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_RAINMETER), IMAGE_ICON, 16, 16, LR_SHARED); } void CTrayWindow::ReadConfig(CConfigParser& parser) diff --git a/Library/resource.h b/Library/resource.h index cc2eed23..b6949301 100644 --- a/Library/resource.h +++ b/Library/resource.h @@ -3,8 +3,8 @@ // Used by Library.rc // #define IDC_STATIC -1 -#define IDI_TRAY 100 -#define IDI_WINDOW 101 +#define IDI_RAINMETER 100 +#define IDI_TRAY 101 #define IDR_CONTEXT_MENU 102 #define IDR_SKIN_MENU 103 #define IDR_MANAGESKINS_MENU 104