mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 17:33:18 +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;
|
return hIMC;
|
||||||
|
|
||||||
dwValue = NtUserAssociateInputContext(hWnd, hIMC, 0);
|
dwValue = NtUserAssociateInputContext(hWnd, hIMC, 0);
|
||||||
if (dwValue == 0)
|
switch (dwValue)
|
||||||
return hOldIMC;
|
|
||||||
if (dwValue != 1)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
hwndFocus = (HWND)NtUserQueryWindow(hWnd, QUERY_WINDOW_FOCUS);
|
|
||||||
if (hwndFocus == hWnd)
|
|
||||||
{
|
{
|
||||||
ImmSetActiveContext(hWnd, hOldIMC, FALSE);
|
case 0:
|
||||||
ImmSetActiveContext(hWnd, hIMC, TRUE);
|
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 */
|
/* Converts the character index */
|
||||||
|
/* Win: CalcCharacterPositionAtoW */
|
||||||
LONG APIENTRY IchWideFromAnsi(LONG cchAnsi, LPCSTR pchAnsi, UINT uCodePage)
|
LONG APIENTRY IchWideFromAnsi(LONG cchAnsi, LPCSTR pchAnsi, UINT uCodePage)
|
||||||
{
|
{
|
||||||
LONG cchWide;
|
LONG cchWide;
|
||||||
|
@ -227,6 +228,7 @@ LONG APIENTRY IchWideFromAnsi(LONG cchAnsi, LPCSTR pchAnsi, UINT uCodePage)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Converts the character index */
|
/* Converts the character index */
|
||||||
|
/* Win: CalcCharacterPositionWtoA */
|
||||||
LONG APIENTRY IchAnsiFromWide(LONG cchWide, LPCWSTR pchWide, UINT uCodePage)
|
LONG APIENTRY IchAnsiFromWide(LONG cchWide, LPCWSTR pchWide, UINT uCodePage)
|
||||||
{
|
{
|
||||||
LONG cb, cchAnsi;
|
LONG cb, cchAnsi;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue