summaryrefslogtreecommitdiff
path: root/plugins/ChangeKeyboardLayout
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-02 14:11:01 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-02 14:11:01 +0000
commit75b1ff75c42644eb36552762652e4b0c9ff071bc (patch)
tree238f026ef373d30a395846f38c302a81961b14ac /plugins/ChangeKeyboardLayout
parent2caba72d51b09368801f23dd8951d589ab4dc809 (diff)
final switch to the typed icolib api
git-svn-id: http://svn.miranda-ng.org/main/trunk@2152 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ChangeKeyboardLayout')
-rw-r--r--plugins/ChangeKeyboardLayout/src/hook_events.cpp44
-rw-r--r--plugins/ChangeKeyboardLayout/src/text_operations.cpp4
2 files changed, 24 insertions, 24 deletions
diff --git a/plugins/ChangeKeyboardLayout/src/hook_events.cpp b/plugins/ChangeKeyboardLayout/src/hook_events.cpp
index 6acadc9aea..323e26ea85 100644
--- a/plugins/ChangeKeyboardLayout/src/hook_events.cpp
+++ b/plugins/ChangeKeyboardLayout/src/hook_events.cpp
@@ -94,8 +94,8 @@ void RegPopupActions()
int OnIconsChanged(WPARAM wParam, LPARAM lParam)
{
- hPopupIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"ckl_popup_icon");
- hCopyIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"ckl_copy_icon");
+ hPopupIcon = Skin_GetIcon("ckl_popup_icon");
+ hCopyIcon = Skin_GetIcon("ckl_copy_icon");
RegPopupActions();
return 0;
}
@@ -127,26 +127,26 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
ptszLayStrings[i] = ptszCurrLayout;
mir_free(dbv.ptszVal);
}
- else
+ else
{
ptszLayStrings[i] = dbv.ptszVal;
if(_tcscmp(ptszCurrLayout, ptszLayStrings[i]) == 0)
DBDeleteContactSetting(NULL, ModuleName, ptszTemp);
mir_free(ptszCurrLayout);
- }
+ }
mir_free(ptszTemp);
}
// Прочитаем основные настройки
ReadMainOptions();
-
+
// Прочитаем настройки попапов
ReadPopupOptions();
-
+
// Зарегим звук
SkinAddNewSoundEx(SND_ChangeLayout, ModuleName, LPGEN("Changing Layout"));
SkinAddNewSoundEx(SND_ChangeCase, ModuleName, LPGEN("Changing Case"));
-
+
// Хук на нажатие клавиши
kbHook_All = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)Keyboard_Hook, NULL, GetCurrentThreadId());
@@ -176,7 +176,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
OnIconsChanged(0, 0);
RegPopupActions();
-
+
DBWriteContactSettingDword(NULL, ModuleName, "CurrentVer", PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM));
return 0;
}
@@ -192,13 +192,13 @@ int OnOptionsInitialise(WPARAM wParam, LPARAM lParam)
odp.pszGroup = LPGEN("Plugins");
odp.flags = ODPF_BOLDGROUPS;
odp.pfnDlgProc = DlgMainProcOptions;
- Options_AddPage(wParam, &odp);
-
+ Options_AddPage(wParam, &odp);
+
if (ServiceExists(MS_POPUP_ADDPOPUP)) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP_OPTION_FORM);
odp.pszGroup = LPGEN("PopUps");
odp.pfnDlgProc = DlgPopupsProcOptions;
- Options_AddPage(wParam, &odp);
+ Options_AddPage(wParam, &odp);
}
return 0;
}
@@ -217,7 +217,7 @@ LRESULT CALLBACK Keyboard_Hook(int code, WPARAM wParam, LPARAM lParam)
if ((GetKeyState(VK_MENU)&0x8000)) lcode |= HOTKEYF_ALT;
if ((GetKeyState(VK_LWIN)&0x8000)||(GetKeyState(VK_RWIN)&0x8000)) lcode |= HOTKEYF_EXT;
lcode = lcode<<8;
-
+
if ((wParam != VK_SHIFT) && (wParam != VK_MENU) && (wParam != VK_CONTROL) && (wParam != VK_LWIN) && (wParam != VK_RWIN))
lcode += wParam;
@@ -237,7 +237,7 @@ LRESULT CALLBACK Keyboard_Hook(int code, WPARAM wParam, LPARAM lParam)
else
if ((lcode == moOptions.dwHotkey_Case) && (!(lParam&0x40000000)))
{
- ChangeLayout(NULL, TOT_Case, moOptions.CurrentWordCase);
+ ChangeLayout(NULL, TOT_Case, moOptions.CurrentWordCase);
return 1;
}
}
@@ -247,28 +247,28 @@ LRESULT CALLBACK Keyboard_Hook(int code, WPARAM wParam, LPARAM lParam)
int CALLBACK CKLPopupDlgProc(HWND hWnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
{
LPTSTR ptszPopupText;
-
+
ptszPopupText = (LPTSTR)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, (LPARAM)&ptszPopupText);
switch(uiMessage)
{
case WM_COMMAND:
{
if (HIWORD(wParam) == STN_CLICKED)
- {
+ {
if (!IsBadStringPtr(ptszPopupText, MaxTextSize))
- CopyTextToClipboard(ptszPopupText);
+ CopyTextToClipboard(ptszPopupText);
PUDeletePopUp(hWnd);
-
+
}
break;
}
-
+
case WM_CONTEXTMENU:
{
PUDeletePopUp(hWnd);
break;
}
-
+
case UM_POPUPACTION:
{
if ((lParam == 0) && (!IsBadStringPtr(ptszPopupText, MaxTextSize)))
@@ -277,13 +277,13 @@ int CALLBACK CKLPopupDlgProc(HWND hWnd, UINT uiMessage, WPARAM wParam, LPARAM lP
}
break;
}
-
+
case UM_FREEPLUGINDATA:
{
mir_free(ptszPopupText);
return TRUE;
- }
-
+ }
+
default:
break;
}
diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp
index 779885a383..0bcef386c2 100644
--- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp
+++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp
@@ -321,7 +321,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
if (WindowType == WTYPE_Unknown)
{
SendMessage(hTextWnd, EM_GETSEL, (WPARAM)&crSelection.cpMin, (LPARAM)&crSelection.cpMax);
- if ((SendMessage(hTextWnd, WM_GETDLGCODE, (WPARAM)NULL, (LPARAM)NULL)&(DLGC_HASSETSEL)) && (crSelection.cpMin>=0))
+ if ((SendMessage(hTextWnd, WM_GETDLGCODE, 0, 0)&(DLGC_HASSETSEL)) && (crSelection.cpMin>=0))
WindowType = WTYPE_Edit;
}
@@ -606,7 +606,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
SendMessage(hTextWnd, WM_GETTEXT, (WPARAM)MaxTextSize, (LPARAM)ptszTemp);
for (i = crTemp.cpMin;i<crTemp.cpMax;i++)
ptszTemp[i] = ptszOutText[i-crTemp.cpMin];
- SendMessage(hTextWnd, WM_SETTEXT, (WPARAM)NULL, (LPARAM)ptszTemp);
+ SendMessage(hTextWnd, WM_SETTEXT, 0, (LPARAM)ptszTemp);
SendMessage(hTextWnd, EM_SETSEL, crSelection.cpMin, crSelection.cpMax);
mir_free(ptszTemp);
}