https://git.reactos.org/?p=reactos.git;a=commitdiff;h=82136b3ee4c4164d02c68…
commit 82136b3ee4c4164d02c68bf66ae3d2961661621f
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Fri Jan 28 19:21:21 2022 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Fri Jan 28 19:21:21 2022 +0900
[USER32] Implement ImeWnd_OnImeNotify (#4318)
- Modify CMakeLists.txt to include <ddk/imm.h>
- Implement WM_IME_NOTIFY message handling of the IME window.
CORE-11700
---
win32ss/user/user32/CMakeLists.txt | 1 +
win32ss/user/user32/misc/imm.c | 46 ++++++++++++++++++++++++++++++++++++--
2 files changed, 45 insertions(+), 2 deletions(-)
diff --git a/win32ss/user/user32/CMakeLists.txt b/win32ss/user/user32/CMakeLists.txt
index fb2655dcf6c..4cf9620a5c8 100644
--- a/win32ss/user/user32/CMakeLists.txt
+++ b/win32ss/user/user32/CMakeLists.txt
@@ -4,6 +4,7 @@ spec2def(user32.dll user32.spec ADD_IMPORTLIB)
include_directories(
${REACTOS_SOURCE_DIR}/sdk/include/reactos/subsys
include
+ ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine
${REACTOS_SOURCE_DIR}/win32ss/include)
list(APPEND SOURCE
diff --git a/win32ss/user/user32/misc/imm.c b/win32ss/user/user32/misc/imm.c
index 7e70167b277..8a7a5eb7c14 100644
--- a/win32ss/user/user32/misc/imm.c
+++ b/win32ss/user/user32/misc/imm.c
@@ -11,6 +11,7 @@
#include <user32.h>
#include <strsafe.h>
+#include <ddk/imm.h>
WINE_DEFAULT_DEBUG_CHANNEL(user32);
@@ -209,6 +210,48 @@ static VOID User32UpdateImcOfImeUI(PIMEUI pimeui, HIMC hNewIMC)
User32SetImeWindowOfImc(hNewIMC, hImeWnd);
}
+static LRESULT ImeWnd_OnImeNotify(PIMEUI pimeui, WPARAM wParam, LPARAM lParam)
+{
+ LRESULT ret = 0;
+ HIMC hIMC;
+ LPINPUTCONTEXT pIC;
+ HWND hwndUI, hwndIMC;
+
+ switch (wParam)
+ {
+ case IMN_SETCONVERSIONMODE:
+ case IMN_SETOPENSTATUS:
+ hIMC = pimeui->hIMC;
+ pIC = IMM_FN(ImmLockIMC)(hIMC);
+ if (pIC)
+ {
+ hwndIMC = pimeui->hwndIMC;
+ if (IsWindow(hwndIMC))
+ {
+ NtUserNotifyIMEStatus(hwndIMC, pIC->fOpen,
pIC->fdwConversion);
+ }
+ else
+ {
+ // TODO:
+ }
+
+ IMM_FN(ImmUnlockIMC)(hIMC);
+ }
+ /* FALL THROUGH */
+ default:
+ ret = User32SendImeUIMessage(pimeui, WM_IME_NOTIFY, wParam, lParam, TRUE);
+ break;
+
+ case IMN_PRIVATE:
+ hwndUI = pimeui->hwndUI;
+ if (IsWindow(hwndUI))
+ ret = SendMessageW(hwndUI, WM_IME_NOTIFY, wParam, lParam);
+ break;
+ }
+
+ return ret;
+}
+
static HWND User32CreateImeUIWindow(PIMEUI pimeui, HKL hKL)
{
IMEINFOEX ImeInfoEx;
@@ -428,8 +471,7 @@ LRESULT WINAPI ImeWndProc_common( HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lPa
break;
case WM_IME_NOTIFY:
- // TODO:
- break;
+ return ImeWnd_OnImeNotify(pimeui, wParam, lParam);
case WM_IME_REQUEST:
break;