diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-07 21:21:17 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-07 21:21:17 +0000 |
commit | 204e6f3fb56cd033bc02d19959a7994ad2002f4b (patch) | |
tree | 1326899193477ae46c7a334ad40285b79a93eedb /plugins/TranslitSwitcher | |
parent | 8c760ecefaf5085cb8cae48fccf07f3115c99287 (diff) |
we don't create service functions inside OnModulesLoaded
git-svn-id: http://svn.miranda-ng.org/main/trunk@4380 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TranslitSwitcher')
-rw-r--r-- | plugins/TranslitSwitcher/src/TranslitSwitcher.cpp | 99 |
1 files changed, 45 insertions, 54 deletions
diff --git a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp index 3d8adacbbf..79cb699af1 100644 --- a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp +++ b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp @@ -79,60 +79,6 @@ INT_PTR ServiceInvert(WPARAM wParam, LPARAM lParam) int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- CreateServiceFunction(MS_TS_SWITCHLAYOUT, ServiceSwitch);
- CreateServiceFunction(MS_TS_TRANSLITLAYOUT, ServiceTranslit);
- CreateServiceFunction(MS_TS_INVERTCASE, ServiceInvert);
-
- HOTKEYDESC hkd = {0};
- hkd.cbSize = sizeof(hkd);
- hkd.dwFlags = HKD_TCHAR;
-
- hkd.pszName = "TranslitSwitcher/ConvertAllOrSelected";
- hkd.ptszDescription = LPGENT("Convert All / Selected");
- hkd.ptszSection = _T("TranslitSwitcher");
- hkd.pszService = MS_TS_SWITCHLAYOUT;
- hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL+HKCOMB_A, 'R') | HKF_MIRANDA_LOCAL;
- hkd.lParam = FALSE;
-
- Hotkey_Register(&hkd);
-
- hkd.pszName = "TranslitSwitcher/ConvertLastOrSelected";
- hkd.ptszDescription = LPGENT("Convert Last / Selected");
- hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT+HKCOMB_A, 'R') | HKF_MIRANDA_LOCAL;
- hkd.lParam = TRUE;
-
- Hotkey_Register(&hkd);
-
- hkd.pszName = "TranslitSwitcher/TranslitAllOrSelected";
- hkd.ptszDescription = LPGENT("Translit All / Selected");
- hkd.pszService = MS_TS_TRANSLITLAYOUT;
- hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL+HKCOMB_A, 'T') | HKF_MIRANDA_LOCAL;
- hkd.lParam = FALSE;
-
- Hotkey_Register(&hkd);
-
- hkd.pszName = "TranslitSwitcher/TranslitLastOrSelected";
- hkd.ptszDescription = LPGENT("Translit Last / Selected");
- hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT+HKCOMB_A, 'T') | HKF_MIRANDA_LOCAL;
- hkd.lParam = TRUE;
-
- Hotkey_Register(&hkd);
-
- hkd.pszName = "TranslitSwitcher/InvertCaseAllOrSelected";
- hkd.ptszDescription = LPGENT("Invert Case All / Selected");
- hkd.pszService = MS_TS_INVERTCASE;
- hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL+HKCOMB_A, 'Y') | HKF_MIRANDA_LOCAL;
- hkd.lParam = FALSE;
-
- Hotkey_Register(&hkd);
-
- hkd.pszName = "TranslitSwitcher/InvertCaseLastOrSelected";
- hkd.ptszDescription = LPGENT("Invert Case Last / Selected");
- hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT+HKCOMB_A, 'Y') | HKF_MIRANDA_LOCAL;
- hkd.lParam = TRUE;
-
- Hotkey_Register(&hkd);
-
HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed);
if (ServiceExists(MS_BB_ADDBUTTON)) {
Icon_Register(hInst, "TabSRMM/TranslitSwitcher", iconList, SIZEOF(iconList));
@@ -206,8 +152,53 @@ extern "C" __declspec(dllexport) int Load(void) {
mir_getLP(&pluginInfoEx);
+ CreateServiceFunction(MS_TS_SWITCHLAYOUT, ServiceSwitch);
+ CreateServiceFunction(MS_TS_TRANSLITLAYOUT, ServiceTranslit);
+ CreateServiceFunction(MS_TS_INVERTCASE, ServiceInvert);
+
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
+
+ HOTKEYDESC hkd = { sizeof(hkd) };
+ hkd.dwFlags = HKD_TCHAR;
+ hkd.pszName = "TranslitSwitcher/ConvertAllOrSelected";
+ hkd.ptszDescription = LPGENT("Convert All / Selected");
+ hkd.ptszSection = _T("TranslitSwitcher");
+ hkd.pszService = MS_TS_SWITCHLAYOUT;
+ hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL+HKCOMB_A, 'R') | HKF_MIRANDA_LOCAL;
+ Hotkey_Register(&hkd);
+
+ hkd.pszName = "TranslitSwitcher/ConvertLastOrSelected";
+ hkd.ptszDescription = LPGENT("Convert Last / Selected");
+ hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT+HKCOMB_A, 'R') | HKF_MIRANDA_LOCAL;
+ hkd.lParam = TRUE;
+ Hotkey_Register(&hkd);
+
+ hkd.pszName = "TranslitSwitcher/TranslitAllOrSelected";
+ hkd.ptszDescription = LPGENT("Translit All / Selected");
+ hkd.pszService = MS_TS_TRANSLITLAYOUT;
+ hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL+HKCOMB_A, 'T') | HKF_MIRANDA_LOCAL;
+ hkd.lParam = FALSE;
+ Hotkey_Register(&hkd);
+
+ hkd.pszName = "TranslitSwitcher/TranslitLastOrSelected";
+ hkd.ptszDescription = LPGENT("Translit Last / Selected");
+ hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT+HKCOMB_A, 'T') | HKF_MIRANDA_LOCAL;
+ hkd.lParam = TRUE;
+ Hotkey_Register(&hkd);
+
+ hkd.pszName = "TranslitSwitcher/InvertCaseAllOrSelected";
+ hkd.ptszDescription = LPGENT("Invert Case All / Selected");
+ hkd.pszService = MS_TS_INVERTCASE;
+ hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL+HKCOMB_A, 'Y') | HKF_MIRANDA_LOCAL;
+ hkd.lParam = FALSE;
+ Hotkey_Register(&hkd);
+
+ hkd.pszName = "TranslitSwitcher/InvertCaseLastOrSelected";
+ hkd.ptszDescription = LPGENT("Invert Case Last / Selected");
+ hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT+HKCOMB_A, 'Y') | HKF_MIRANDA_LOCAL;
+ hkd.lParam = TRUE;
+ Hotkey_Register(&hkd);
return 0;
}
|