summaryrefslogtreecommitdiff
path: root/plugins/ChangeKeyboardLayout
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-20 23:51:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-20 23:51:53 +0000
commit57abc51aad272a656282a52a460a47abe24e07d6 (patch)
treec6f3538e63c9c736cfa7129423d1b498273278b6 /plugins/ChangeKeyboardLayout
parentb9f120f97699286410fe902f93135235eed0b127 (diff)
- 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
Diffstat (limited to 'plugins/ChangeKeyboardLayout')
-rw-r--r--plugins/ChangeKeyboardLayout/hook_events.c51
1 files changed, 21 insertions, 30 deletions
diff --git a/plugins/ChangeKeyboardLayout/hook_events.c b/plugins/ChangeKeyboardLayout/hook_events.c
index 37f317a448..5fb03491ee 100644
--- a/plugins/ChangeKeyboardLayout/hook_events.c
+++ b/plugins/ChangeKeyboardLayout/hook_events.c
@@ -108,16 +108,8 @@ void RegPopupActions()
int OnIconsChanged(WPARAM wParam, LPARAM lParam)
{
- if(ServiceExists(MS_SKIN2_ADDICON))
- {
- hPopupIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"ckl_popup_icon");
- hCopyIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"ckl_copy_icon");
- }
- else
- {
- hPopupIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUPICON), IMAGE_ICON, 16, 16, 0);
- hCopyIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_COPYICON), IMAGE_ICON, 16, 16, 0);
- }
+ hPopupIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"ckl_popup_icon");
+ hCopyIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"ckl_copy_icon");
RegPopupActions();
return 0;
}
@@ -132,7 +124,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
LPSTR ptszTemp;
SKINICONDESC sid = {0};
- CHAR szFile[MAX_PATH];
+ TCHAR szFile[MAX_PATH];
//Заполняем конфигурационные строки из базы. Если их там нет - генерируем.
@@ -178,25 +170,24 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
hChangeTextLayout = CreateServiceFunction(MS_CKL_CHANGETEXTLAYOUT, APIChangeTextLayout);
// IcoLib support
- if(ServiceExists(MS_SKIN2_ADDICON))
- {
- GetModuleFileNameA(hInst, szFile, MAX_PATH);
- sid.pszDefaultFile = szFile;
- sid.cbSize = SKINICONDESC_SIZE;
-
- sid.pszSection = Translate(ModuleName);
- sid.pszDescription = Translate("Popup");
- sid.pszName = "ckl_popup_icon";
- sid.iDefaultIndex = -IDI_POPUPICON;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- sid.pszDescription = Translate("Copy to clipboard");
- sid.pszName = "ckl_copy_icon";
- sid.iDefaultIndex = -IDI_COPYICON;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged);
- }
+ GetModuleFileName(hInst, szFile, MAX_PATH);
+ sid.ptszDefaultFile = szFile;
+ sid.cbSize = sizeof(sid);
+ sid.flags = SIDF_PATH_TCHAR;
+
+ sid.pszSection = Translate(ModuleName);
+ sid.pszDescription = Translate("Popup");
+ sid.pszName = "ckl_popup_icon";
+ sid.iDefaultIndex = -IDI_POPUPICON;
+ Skin_AddIcon(&sid);
+
+ sid.pszDescription = Translate("Copy to clipboard");
+ sid.pszName = "ckl_copy_icon";
+ sid.iDefaultIndex = -IDI_COPYICON;
+ Skin_AddIcon(&sid);
+
+ hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged);
+
OnIconsChanged(0, 0);
RegPopupActions();