Akihiro Sagawa : imm32: Set the default IME window title and styles as in native.

Alexandre Julliard julliard at winehq.org
Wed Sep 7 10:48:41 CDT 2016


Module: wine
Branch: master
Commit: 686369022d4b54d8eccaa9f76f53c0943634cdc8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=686369022d4b54d8eccaa9f76f53c0943634cdc8

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Wed Sep  7 00:04:45 2016 +0900

imm32: Set the default IME window title and styles as in native.

Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/imm32/imm.c         | 6 ++++--
 dlls/imm32/tests/imm32.c | 9 +++++++++
 dlls/user32/misc.c       | 4 ++--
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index 495d476..3f8ad18 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -109,6 +109,7 @@ static const WCHAR szLayoutTextW[] = {'L','a','y','o','u','t',' ','T','e','x','t
 static const WCHAR szImeRegFmt[] = {'S','y','s','t','e','m','\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\','C','o','n','t','r','o','l','\\','K','e','y','b','o','a','r','d',' ','L','a','y','o','u','t','s','\\','%','0','8','l','x',0};
 
 static const WCHAR szwIME[] = {'I','M','E',0};
+static const WCHAR szwDefaultIME[] = {'D','e','f','a','u','l','t',' ','I','M','E',0};
 
 static CRITICAL_SECTION threaddata_cs;
 static CRITICAL_SECTION_DEBUG critsect_debug =
@@ -1662,8 +1663,9 @@ BOOL WINAPI __wine_register_window(HWND hwnd)
     {
         /* Do not create the window inside of a critical section */
         LeaveCriticalSection(&threaddata_cs);
-        new = CreateWindowExW( WS_EX_TOOLWINDOW,
-                               szwIME, NULL, WS_POPUP, 0, 0, 1, 1, 0, 0, 0, 0);
+        new = CreateWindowExW( 0, szwIME, szwDefaultIME,
+                               WS_POPUP | WS_DISABLED | WS_CLIPSIBLINGS,
+                               0, 0, 1, 1, 0, 0, 0, 0);
         /* thread_data is in the current thread so we can assume it's still valid */
         EnterCriticalSection(&threaddata_cs);
         /* See if anyone beat us */
diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c
index 8e45efb..a2072e9 100644
--- a/dlls/imm32/tests/imm32.c
+++ b/dlls/imm32/tests/imm32.c
@@ -866,6 +866,8 @@ static void test_ImmDefaultHwnd(void)
     HWND def1, def3;
     HANDLE thread;
     HWND hwnd;
+    char title[16];
+    LONG style;
 
     hwnd = CreateWindowExA(WS_EX_CLIENTEDGE, "EDIT", "Wine imm32.dll test",
                            WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
@@ -882,6 +884,13 @@ static void test_ImmDefaultHwnd(void)
 
     def1 = ImmGetDefaultIMEWnd(hwnd);
 
+    GetWindowTextA(def1, title, sizeof(title));
+    ok(!strcmp(title, "Default IME"), "got %s\n", title);
+    style = GetWindowLongA(def1, GWL_STYLE);
+    ok(style == (WS_DISABLED | WS_POPUP | WS_CLIPSIBLINGS), "got %08x\n", style);
+    style = GetWindowLongA(def1, GWL_EXSTYLE);
+    ok(style == 0, "got %08x\n", style);
+
     imc2 = ImmCreateContext();
     ImmSetOpenStatus(imc2, TRUE);
 
diff --git a/dlls/user32/misc.c b/dlls/user32/misc.c
index 1e60e0d..beed6aa 100644
--- a/dlls/user32/misc.c
+++ b/dlls/user32/misc.c
@@ -882,7 +882,7 @@ LRESULT WINAPI ImeWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
 {
     HWND uiwnd;
 
-    if (msg==WM_CREATE || msg==WM_NCCREATE)
+    if (msg==WM_CREATE)
         return TRUE;
 
     if (imm_get_ui_window && is_ime_ui_msg(msg))
@@ -899,7 +899,7 @@ LRESULT WINAPI ImeWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
 {
     HWND uiwnd;
 
-    if (msg==WM_CREATE || msg==WM_NCCREATE)
+    if (msg==WM_CREATE)
         return TRUE;
 
     if (imm_get_ui_window && is_ime_ui_msg(msg))




More information about the wine-cvs mailing list