summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-04-05 13:06:29 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-04-05 13:06:29 +0000
commitc661d1479bbbe836f143c333d6643bcc6faa2393 (patch)
treed394c3b384d72ea5f10aa02837c6848712275efb
parent36feebe9c35c5a4da3f0e35fd5ef819af225fbf2 (diff)
added removing buttons when plugin unloads (fixed #302)
git-svn-id: http://svn.miranda-ng.org/main/trunk@4315 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/TranslitSwitcher/src/TranslitSwitcher.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp
index 71ea12157a..7e6afc2bcc 100644
--- a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp
+++ b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp
@@ -164,6 +164,36 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
return 0;
}
+int OnPreShutdown(WPARAM wParam, LPARAM lParam)
+{
+ if (ServiceExists(MS_BB_REMOVEBUTTON)) {
+ BBButton bbd = {0};
+ bbd.cbSize = sizeof(BBButton);
+ bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON;
+ bbd.pszModuleName = "Switch Layout and Send";
+ bbd.ptszTooltip = TranslateT("Switch Layout and Send");
+ bbd.hIcon = iconList[0].hIcolib;
+ bbd.dwButtonID = 1;
+ bbd.dwDefPos = 30;
+ CallService(MS_BB_REMOVEBUTTON, 0, (LPARAM)&bbd);
+
+ bbd.pszModuleName = "Translit and Send";
+ bbd.ptszTooltip = TranslateT("Translit and Send");
+ bbd.hIcon = iconList[1].hIcolib;
+ bbd.dwButtonID = 1;
+ bbd.dwDefPos = 40;
+ CallService(MS_BB_REMOVEBUTTON, 0, (LPARAM)&bbd);
+
+ bbd.pszModuleName = "Invert Case and Send";
+ bbd.ptszTooltip = TranslateT("Invert Case and Send");
+ bbd.hIcon = iconList[2].hIcolib;
+ bbd.dwButtonID = 1;
+ bbd.dwDefPos = 50;
+ CallService(MS_BB_REMOVEBUTTON, 0, (LPARAM)&bbd);
+
+ }
+ return 0;
+}
//-------------------------------------------------------------------------------------------------------
extern "C" __declspec(dllexport) int Load(void)
@@ -171,6 +201,7 @@ extern "C" __declspec(dllexport) int Load(void)
mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
return 0;
}