From 57abc51aad272a656282a52a460a47abe24e07d6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 20 Jun 2012 23:51:53 +0000 Subject: - MS_SKIN2_ADDICON replaced with Skin_AddIcon; - SKINICONDESC_SIZE* constants removed and replaced with sizeof(sid); - added SIDF_PATH_UNICODE for all plugins; - dynamic translation fixed in the icolib options dialog git-svn-id: http://svn.miranda-ng.org/main/trunk@507 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp | 25 +++++------------------ 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'plugins/TranslitSwitcher') diff --git a/plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp index b6f0e43207..e762b2a5a0 100644 --- a/plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp +++ b/plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp @@ -78,7 +78,7 @@ INT_PTR ServiceInvert(WPARAM wParam, LPARAM lParam) int OnModulesLoaded(WPARAM wParam, LPARAM lParam) { - HICON hSwitchIcon = NULL, hTranslitIcon = NULL, hInvertIcon = NULL; + HANDLE hSwitchIcon = NULL, hTranslitIcon = NULL, hInvertIcon = NULL; HOTKEYDESC hkd = {0}; hkd.cbSize = sizeof(hkd); @@ -135,8 +135,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) Hotkey_Register(&hkd); hOnButtonPressed = HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed); - if (ServiceExists(MS_BB_ADDBUTTON) && ServiceExists(MS_SKIN2_ADDICON)) - { + if (ServiceExists(MS_BB_ADDBUTTON)) { SKINICONDESC sid = {0}; sid.cbSize = sizeof(SKINICONDESC); sid.flags = SIDF_TCHAR; @@ -145,27 +144,18 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) sid.ptszDescription = _T("SwitchLayout and Send"); sid.pszName = "SwitchLayout and Send"; sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SWITCHSEND)); - hSwitchIcon = (HICON)CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid); + hSwitchIcon = Skin_AddIcon(&sid); sid.ptszDescription = _T("Translit and Send"); sid.pszName = "Translit and Send"; sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_TRANSLITSEND)); - hTranslitIcon = (HICON)CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid); + hTranslitIcon = Skin_AddIcon(&sid); sid.ptszDescription = _T("Invert Case and Send"); sid.pszName = "Invert Case and Send"; sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_INVERTSEND)); - hInvertIcon = (HICON)CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid); - } - else if (ServiceExists(MS_BB_ADDBUTTON)) - { - hSwitchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SWITCHSEND)); - hTranslitIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_TRANSLITSEND)); - hInvertIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_INVERTSEND)); - } + hInvertIcon = Skin_AddIcon(&sid); - if (ServiceExists(MS_BB_ADDBUTTON)) - { BBButton bbd = {0}; bbd.cbSize = sizeof(BBButton); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON; @@ -190,11 +180,6 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) bbd.dwDefPos = 50; CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd); } - - DestroyIcon(hSwitchIcon); - DestroyIcon(hTranslitIcon); - DestroyIcon(hInvertIcon); - return 0; } -- cgit v1.2.3