From c4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 2 Dec 2012 18:19:49 +0000 Subject: new easy standard way of registering icons: Icon_Register git-svn-id: http://svn.miranda-ng.org/main/trunk@2601 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AutoShutdown/src/main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'plugins/AutoShutdown/src/main.cpp') diff --git a/plugins/AutoShutdown/src/main.cpp b/plugins/AutoShutdown/src/main.cpp index c81b86a0b8..4128bd7a1a 100644 --- a/plugins/AutoShutdown/src/main.cpp +++ b/plugins/AutoShutdown/src/main.cpp @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. HINSTANCE hInst; static HANDLE hHookModulesLoaded; -HANDLE hActiveIcon,hInactiveIcon; int hLangpack; PLUGININFOEX pluginInfo = { @@ -39,6 +38,13 @@ PLUGININFOEX pluginInfo = { {0x9de24579, 0x5c5c, 0x49aa, {0x80, 0xe8, 0x4d, 0x38, 0xe4, 0x34, 0x4e, 0x63}} }; +IconItem iconList[] = +{ + { LPGEN("Header"), "AutoShutdown_Header", IDI_HEADER }, + { LPGEN("Active"), "AutoShutdown_Active", IDI_ACTIVE }, + { LPGEN("Inactive"), "AutoShutdown_Inactive", IDI_INACTIVE }, +}; + BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, VOID *pReserved) { hInst = hinstDLL; @@ -89,6 +95,8 @@ extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD m extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[]={MIID_SHUTDOWN,MIID_LAST}; +///////////////////////////////////////////////////////////////////////////////////////// + extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfo); @@ -100,9 +108,7 @@ extern "C" __declspec(dllexport) int Load(void) if(InitFrame()) return 1; /* before icons */ /* shared */ - IcoLib_AddIconRes("AutoShutdown_Header",TranslateT("Automatic Shutdown"),TranslateT("Header"),hInst,IDI_HEADER,TRUE); - hActiveIcon=IcoLib_AddIconRes("AutoShutdown_Active",TranslateT("Automatic Shutdown"),TranslateT("Active"),hInst,IDI_ACTIVE,FALSE); - hInactiveIcon=IcoLib_AddIconRes("AutoShutdown_Inactive",TranslateT("Automatic Shutdown"),TranslateT("Inactive"),hInst,IDI_INACTIVE,FALSE); + Icon_Register(hInst, "Automatic Shutdown", iconList, SIZEOF(iconList)); InitShutdownSvc(); InitWatcher(); /* before InitSettingsDlg() */ -- cgit v1.2.3