summaryrefslogtreecommitdiff
path: root/plugins/TranslitSwitcher
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-12-01 13:25:11 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-12-01 13:25:11 +0000
commit854959cbc0a1bad2c086214be4d1a829b17a61f3 (patch)
treeee3de50f4b4e57f54ae20d139f97fa469ff90d34 /plugins/TranslitSwitcher
parent73ddc73d92675399e4619758d4b0881418de0a6d (diff)
icolib: icon creation quirks
git-svn-id: http://svn.miranda-ng.org/main/trunk@2588 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TranslitSwitcher')
-rw-r--r--plugins/TranslitSwitcher/src/TranslitSwitcher.cpp33
-rw-r--r--plugins/TranslitSwitcher/src/TranslitSwitcher.h2
2 files changed, 19 insertions, 16 deletions
diff --git a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp
index bc1d41f08d..1e934a070a 100644
--- a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp
+++ b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp
@@ -75,16 +75,14 @@ INT_PTR ServiceInvert(WPARAM wParam, LPARAM lParam)
int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- HANDLE hSwitchIcon = NULL, hTranslitIcon = NULL, hInvertIcon = NULL;
+ hService = CreateServiceFunction(MS_TS_SWITCHLAYOUT, ServiceSwitch);
+ hService2 = CreateServiceFunction(MS_TS_TRANSLITLAYOUT, ServiceTranslit);
+ hService3 = CreateServiceFunction(MS_TS_INVERTCASE, ServiceInvert);
HOTKEYDESC hkd = {0};
hkd.cbSize = sizeof(hkd);
hkd.dwFlags = HKD_TCHAR;
- hService = CreateServiceFunction(MS_TS_SWITCHLAYOUT, ServiceSwitch);
- hService2 = CreateServiceFunction(MS_TS_TRANSLITLAYOUT, ServiceTranslit);
- hService3 = CreateServiceFunction(MS_TS_INVERTCASE, ServiceInvert);
-
hkd.pszName = "TranslitSwitcher/ConvertAllOrSelected";
hkd.ptszDescription = _T("Convert All / Selected");
hkd.ptszSection = _T("TranslitSwitcher");
@@ -133,25 +131,28 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
hOnButtonPressed = HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed);
if (ServiceExists(MS_BB_ADDBUTTON)) {
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(SKINICONDESC);
- sid.flags = SIDF_TCHAR;
+ TCHAR tszPath[MAX_PATH];
+ GetModuleFileName(hInst, tszPath, SIZEOF(tszPath));
+
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.flags = SIDF_ALL_TCHAR;
sid.ptszSection = _T("TabSRMM/TranslitSwitcher");
sid.cx = sid.cy = 16;
- sid.ptszDescription = _T("SwitchLayout and Send");
- sid.pszName = "SwitchLayout and Send";
- sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SWITCHSEND));
- hSwitchIcon = Skin_AddIcon(&sid);
+ sid.ptszDescription = _T("Switch Layout and Send");
+ sid.pszName = "Switch Layout and Send";
+ sid.ptszDefaultFile = tszPath;
+ sid.iDefaultIndex = -IDI_SWITCHSEND;
+ HANDLE hSwitchIcon = Skin_AddIcon(&sid);
sid.ptszDescription = _T("Translit and Send");
sid.pszName = "Translit and Send";
- sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_TRANSLITSEND));
- hTranslitIcon = Skin_AddIcon(&sid);
+ sid.iDefaultIndex = -IDI_TRANSLITSEND;
+ HANDLE 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 = Skin_AddIcon(&sid);
+ sid.iDefaultIndex = -IDI_INVERTSEND;
+ HANDLE hInvertIcon = Skin_AddIcon(&sid);
BBButton bbd = {0};
bbd.cbSize = sizeof(BBButton);
diff --git a/plugins/TranslitSwitcher/src/TranslitSwitcher.h b/plugins/TranslitSwitcher/src/TranslitSwitcher.h
index ea29c2c7bf..f8f99f0bb3 100644
--- a/plugins/TranslitSwitcher/src/TranslitSwitcher.h
+++ b/plugins/TranslitSwitcher/src/TranslitSwitcher.h
@@ -19,6 +19,8 @@ Boston, MA 02111-1307, USA.
#define MIRANDA_VER 0x0A00
+#define _CRT_SECURE_NO_WARNINGS
+
#ifndef __TRANSLITSWIITCHER_H__
#define __TRANSLITSWIITCHER_H__