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/ChangeKeyboardLayout/hook_events.c | 51 ++++++++++++------------------ 1 file changed, 21 insertions(+), 30 deletions(-) (limited to 'plugins/ChangeKeyboardLayout') 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(); -- cgit v1.2.3