summaryrefslogtreecommitdiff
path: root/plugins/TranslitSwitcher/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2016-12-01 20:51:42 +0300
committerGeorge Hazan <ghazan@miranda.im>2016-12-01 21:49:54 +0300
commitf9c7760f54c279327a977b0cb5ee028c8f0c0bfb (patch)
tree0a1cf4602a5eac89dc38606cc91981c2166a83e0 /plugins/TranslitSwitcher/src
parent40203d30ad1a569cfea61442782393b200e9fbe3 (diff)
more fixes
Diffstat (limited to 'plugins/TranslitSwitcher/src')
-rw-r--r--plugins/TranslitSwitcher/src/TranslitSwitcher.cpp81
-rw-r--r--plugins/TranslitSwitcher/src/stdafx.h1
2 files changed, 25 insertions, 57 deletions
diff --git a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp
index 497e429a3d..21bdd2b69e 100644
--- a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp
+++ b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp
@@ -80,63 +80,31 @@ INT_PTR ServiceInvert(WPARAM, LPARAM lParam)
int OnModulesLoaded(WPARAM, LPARAM)
{
HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed);
- if (ServiceExists(MS_BB_ADDBUTTON)) {
- Icon_Register(hInst, "TabSRMM/TranslitSwitcher", iconList, _countof(iconList));
-
- BBButton bbd = { 0 };
- bbd.cbSize = sizeof(BBButton);
- bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON;
- bbd.pszModuleName = "Switch Layout and Send";
- bbd.pwszTooltip = TranslateT("Switch Layout and Send");
- bbd.hIcon = iconList[0].hIcolib;
- bbd.dwButtonID = 1;
- bbd.dwDefPos = 30;
- CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
-
- bbd.pszModuleName = "Translit and Send";
- bbd.pwszTooltip = TranslateT("Translit and Send");
- bbd.hIcon = iconList[1].hIcolib;
- bbd.dwButtonID = 1;
- bbd.dwDefPos = 40;
- CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
-
- bbd.pszModuleName = "Invert Case and Send";
- bbd.pwszTooltip = TranslateT("Invert Case and Send");
- bbd.hIcon = iconList[2].hIcolib;
- bbd.dwButtonID = 1;
- bbd.dwDefPos = 50;
- CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
- }
- return 0;
-}
-int OnPreShutdown(WPARAM, 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.pwszTooltip = 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.pwszTooltip = 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.pwszTooltip = TranslateT("Invert Case and Send");
- bbd.hIcon = iconList[2].hIcolib;
- bbd.dwButtonID = 1;
- bbd.dwDefPos = 50;
- CallService(MS_BB_REMOVEBUTTON, 0, (LPARAM)&bbd);
- }
+ Icon_Register(hInst, "TabSRMM/TranslitSwitcher", iconList, _countof(iconList));
+
+ BBButton bbd = {};
+ bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON;
+ bbd.pszModuleName = "Switch Layout and Send";
+ bbd.pwszTooltip = TranslateT("Switch Layout and Send");
+ bbd.hIcon = iconList[0].hIcolib;
+ bbd.dwButtonID = 1;
+ bbd.dwDefPos = 30;
+ Srmm_AddButton(&bbd);
+
+ bbd.pszModuleName = "Translit and Send";
+ bbd.pwszTooltip = TranslateT("Translit and Send");
+ bbd.hIcon = iconList[1].hIcolib;
+ bbd.dwButtonID = 1;
+ bbd.dwDefPos = 40;
+ Srmm_AddButton(&bbd);
+
+ bbd.pszModuleName = "Invert Case and Send";
+ bbd.pwszTooltip = TranslateT("Invert Case and Send");
+ bbd.hIcon = iconList[2].hIcolib;
+ bbd.dwButtonID = 1;
+ bbd.dwDefPos = 50;
+ Srmm_AddButton(&bbd);
return 0;
}
@@ -151,7 +119,6 @@ extern "C" __declspec(dllexport) int Load(void)
CreateServiceFunction(MS_TS_INVERTCASE, ServiceInvert);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
- HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
HOTKEYDESC hkd = { sizeof(hkd) };
hkd.dwFlags = HKD_UNICODE;
diff --git a/plugins/TranslitSwitcher/src/stdafx.h b/plugins/TranslitSwitcher/src/stdafx.h
index 662bef8ed7..b0c897172d 100644
--- a/plugins/TranslitSwitcher/src/stdafx.h
+++ b/plugins/TranslitSwitcher/src/stdafx.h
@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA.
#include <m_popup.h>
#include <m_string.h>
+#include <m_message.h>
#include <m_msg_buttonsbar.h>
#include <m_smileyadd.h>
#include <m_ieview.h>