mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[IMM32] Rewrite ImmSetCandidateWindow (#3884)
Implementing Japanese input... CORE-11700
This commit is contained in:
parent
f26614afff
commit
0af58654a3
1 changed files with 17 additions and 12 deletions
|
@ -3452,29 +3452,34 @@ LRESULT WINAPI ImmRequestMessageW(HIMC hIMC, WPARAM wParam, LPARAM lParam)
|
||||||
BOOL WINAPI ImmSetCandidateWindow(
|
BOOL WINAPI ImmSetCandidateWindow(
|
||||||
HIMC hIMC, LPCANDIDATEFORM lpCandidate)
|
HIMC hIMC, LPCANDIDATEFORM lpCandidate)
|
||||||
{
|
{
|
||||||
InputContextData *data = get_imc_data(hIMC);
|
#define MAX_CANDIDATEFORM 4
|
||||||
|
DWORD dwImeThreadId, dwThreadId;
|
||||||
|
HWND hWnd;
|
||||||
|
LPINPUTCONTEXT pIC;
|
||||||
|
|
||||||
TRACE("(%p, %p)\n", hIMC, lpCandidate);
|
TRACE("(%p, %p)\n", hIMC, lpCandidate);
|
||||||
|
|
||||||
if (!data || !lpCandidate)
|
if (lpCandidate->dwIndex >= MAX_CANDIDATEFORM)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (IMM_IsCrossThreadAccess(NULL, hIMC))
|
dwImeThreadId = Imm32QueryInputContext(hIMC, 1);
|
||||||
|
dwThreadId = GetCurrentThreadId();
|
||||||
|
if (dwImeThreadId != dwThreadId)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
TRACE("\t%x, %x, %s, %s\n",
|
pIC = ImmLockIMC(hIMC);
|
||||||
lpCandidate->dwIndex, lpCandidate->dwStyle,
|
if (pIC == NULL)
|
||||||
wine_dbgstr_point(&lpCandidate->ptCurrentPos),
|
|
||||||
wine_dbgstr_rect(&lpCandidate->rcArea));
|
|
||||||
|
|
||||||
if (lpCandidate->dwIndex >= ARRAY_SIZE(data->IMC.cfCandForm))
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
data->IMC.cfCandForm[lpCandidate->dwIndex] = *lpCandidate;
|
hWnd = pIC->hWnd;
|
||||||
ImmNotifyIME(hIMC, NI_CONTEXTUPDATED, 0, IMC_SETCANDIDATEPOS);
|
pIC->cfCandForm[lpCandidate->dwIndex] = *lpCandidate;
|
||||||
ImmInternalSendIMENotify(data, IMN_SETCANDIDATEPOS, 1 << lpCandidate->dwIndex);
|
|
||||||
|
|
||||||
|
ImmUnlockIMC(hIMC);
|
||||||
|
|
||||||
|
Imm32NotifyAction(hIMC, hWnd, NI_CONTEXTUPDATED, 0, IMC_SETCANDIDATEPOS,
|
||||||
|
IMN_SETCANDIDATEPOS, (1 << lpCandidate->dwIndex));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#undef MAX_CANDIDATEFORM
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
Loading…
Reference in a new issue