From bd820972afe24409e6b570adbc45f5dc0fa2385d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 11 Apr 2013 07:08:40 +0000 Subject: SRMM icons to be unloaded automatically git-svn-id: http://svn.miranda-ng.org/main/trunk@4418 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HistorySweeperLight/src/main.cpp | 34 +++++++++----------------------- 1 file changed, 9 insertions(+), 25 deletions(-) (limited to 'plugins/HistorySweeperLight/src') diff --git a/plugins/HistorySweeperLight/src/main.cpp b/plugins/HistorySweeperLight/src/main.cpp index 0e96e3ad6f..43518e17b2 100644 --- a/plugins/HistorySweeperLight/src/main.cpp +++ b/plugins/HistorySweeperLight/src/main.cpp @@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. HINSTANCE hInst; -static HANDLE hHooks[5]; int hLangpack; static PLUGININFOEX pluginInfoEx = @@ -85,37 +84,32 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) if (sweep == 0) sid.szTooltip = Translate("Keep all events"); else if (sweep == 1) - { sid.szTooltip = Translate(time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)]); - } else if (sweep == 2) - { sid.szTooltip = Translate(keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)]); - } else if (sweep == 3) - { sid.szTooltip = Translate("Delete all events"); - } + sid.flags = MBF_HIDDEN; - CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid); + Srmm_AddIcon(&sid); sid.dwId = 1; sid.hIcon = LoadIconEx("act1"); sid.szTooltip = Translate(time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)]); sid.flags = MBF_HIDDEN; - CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid); + Srmm_AddIcon(&sid); sid.dwId = 2; sid.hIcon = LoadIconEx("act2"); sid.szTooltip = Translate(keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)]); sid.flags = MBF_HIDDEN; - CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid); + Srmm_AddIcon(&sid); sid.dwId = 3; sid.hIcon = LoadIconEx("actDel"); sid.szTooltip = Translate("Delete all events"); sid.flags = MBF_HIDDEN; - CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid); + Srmm_AddIcon(&sid); // for new contacts for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { @@ -133,8 +127,8 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) } } - hHooks[2] = HookEvent(ME_MSG_WINDOWEVENT, OnWindowEvent); - hHooks[3] = HookEvent(ME_MSG_ICONPRESSED, OnIconPressed); + HookEvent(ME_MSG_WINDOWEVENT, OnWindowEvent); + HookEvent(ME_MSG_ICONPRESSED, OnIconPressed); return 0; } @@ -146,11 +140,10 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda extern "C" __declspec(dllexport) int Load(void) { - mir_getLP(&pluginInfoEx); - hHooks[0] = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); - hHooks[1] = HookEvent(ME_OPT_INITIALISE, HSOptInitialise); + HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); + HookEvent(ME_OPT_INITIALISE, HSOptInitialise); InitIcons(); @@ -159,15 +152,6 @@ extern "C" __declspec(dllexport) int Load(void) extern "C" __declspec(dllexport) int Unload(void) { - int i; - ShutdownAction(); - - for (i = 0; i < SIZEOF(hHooks); i++) - { - if (hHooks[i]) - UnhookEvent(hHooks[i]); - } - return 0; } \ No newline at end of file -- cgit v1.2.3