mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 18:15:58 +00:00
[IMM32] Improve ImmAssociateContext readability
CORE-11700
This commit is contained in:
parent
f9b2b1a6cd
commit
72c56c2f1f
2 changed files with 17 additions and 11 deletions
|
@ -513,19 +513,23 @@ HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
|
|||
return hIMC;
|
||||
|
||||
dwValue = NtUserAssociateInputContext(hWnd, hIMC, 0);
|
||||
if (dwValue == 0)
|
||||
return hOldIMC;
|
||||
if (dwValue != 1)
|
||||
return NULL;
|
||||
|
||||
hwndFocus = (HWND)NtUserQueryWindow(hWnd, QUERY_WINDOW_FOCUS);
|
||||
if (hwndFocus == hWnd)
|
||||
switch (dwValue)
|
||||
{
|
||||
ImmSetActiveContext(hWnd, hOldIMC, FALSE);
|
||||
ImmSetActiveContext(hWnd, hIMC, TRUE);
|
||||
}
|
||||
case 0:
|
||||
return hOldIMC;
|
||||
|
||||
return hOldIMC;
|
||||
case 1:
|
||||
hwndFocus = (HWND)NtUserQueryWindow(hWnd, QUERY_WINDOW_FOCUS);
|
||||
if (hwndFocus == hWnd)
|
||||
{
|
||||
ImmSetActiveContext(hWnd, hOldIMC, FALSE);
|
||||
ImmSetActiveContext(hWnd, hIMC, TRUE);
|
||||
}
|
||||
return hOldIMC;
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
|
@ -207,6 +207,7 @@ LPSTR APIENTRY Imm32AnsiFromWide(LPCWSTR pszW)
|
|||
}
|
||||
|
||||
/* Converts the character index */
|
||||
/* Win: CalcCharacterPositionAtoW */
|
||||
LONG APIENTRY IchWideFromAnsi(LONG cchAnsi, LPCSTR pchAnsi, UINT uCodePage)
|
||||
{
|
||||
LONG cchWide;
|
||||
|
@ -227,6 +228,7 @@ LONG APIENTRY IchWideFromAnsi(LONG cchAnsi, LPCSTR pchAnsi, UINT uCodePage)
|
|||
}
|
||||
|
||||
/* Converts the character index */
|
||||
/* Win: CalcCharacterPositionWtoA */
|
||||
LONG APIENTRY IchAnsiFromWide(LONG cchWide, LPCWSTR pchWide, UINT uCodePage)
|
||||
{
|
||||
LONG cb, cchAnsi;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue