https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a71de262d321d77782d0f…
commit a71de262d321d77782d0fcd0b734543c6e9a25ec
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Wed Jul 28 23:23:09 2021 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Wed Jul 28 23:23:09 2021 +0900
[IMM32] Rewrite ImmSetStatusWindowPos (#3852)
Implementing Japanese input... CORE-11700
---
dll/win32/imm32/imm.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c
index 66c740a925f..e47224e0a6a 100644
--- a/dll/win32/imm32/imm.c
+++ b/dll/win32/imm32/imm.c
@@ -3129,25 +3129,29 @@ BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
*/
BOOL WINAPI ImmSetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
{
- InputContextData *data = get_imc_data(hIMC);
+ LPINPUTCONTEXT pIC;
+ HWND hWnd;
+ DWORD dwImeThreadId, dwThreadId;
- TRACE("(%p, %p)\n", hIMC, lpptPos);
+ TRACE("ImmSetStatusWindowPos(%p, {%ld, %ld})\n", hIMC, lpptPos->x,
lpptPos->y);
- if (!data || !lpptPos)
- {
- SetLastError(ERROR_INVALID_HANDLE);
+ dwImeThreadId = Imm32QueryInputContext(hIMC, 1);
+ dwThreadId = GetCurrentThreadId();
+ if (dwImeThreadId != dwThreadId)
return FALSE;
- }
- if (IMM_IsCrossThreadAccess(NULL, hIMC))
+ pIC = ImmLockIMC(hIMC);
+ if (!pIC)
return FALSE;
- TRACE("\t%s\n", wine_dbgstr_point(lpptPos));
+ hWnd = pIC->hWnd;
+ pIC->ptStatusWndPos = *lpptPos;
+ pIC->fdwInit |= INIT_STATUSWNDPOS;
- data->IMC.ptStatusWndPos = *lpptPos;
- ImmNotifyIME( hIMC, NI_CONTEXTUPDATED, 0, IMC_SETSTATUSWINDOWPOS);
- ImmInternalSendIMENotify(data, IMN_SETSTATUSWINDOWPOS, 0);
+ ImmUnlockIMC(hIMC);
+ Imm32NotifyAction(hIMC, hWnd, NI_CONTEXTUPDATED, 0,
+ IMC_SETSTATUSWINDOWPOS, IMN_SETSTATUSWINDOWPOS, 0);
return TRUE;
}