Aric Stewart <aric(a)codeweavers.com> writes:
@@ -2323,12 +2323,18 @@ BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
if (data->imeWnd == NULL) { - /* create the ime window */ - data->imeWnd = CreateWindowExW( WS_EX_TOOLWINDOW, - data->immKbd->imeClassName, NULL, WS_POPUP, 0, 0, 1, 1, 0, - 0, data->immKbd->hIME, 0); - SetWindowLongPtrW(data->imeWnd, IMMGWL_IMC, (LONG_PTR)data); - IMM_GetThreadData()->hwndDefault = data->imeWnd; + HWND def = IMM_GetThreadData()->hwndDefault; + if (def == NULL) + { + /* create the ime window */ + data->imeWnd = CreateWindowExW( WS_EX_TOOLWINDOW, + data->immKbd->imeClassName, NULL, WS_POPUP, 0, 0, 1, 1, 0, + 0, data->immKbd->hIME, 0); + SetWindowLongPtrW(data->imeWnd, IMMGWL_IMC, (LONG_PTR)data); + IMM_GetThreadData()->hwndDefault = data->imeWnd; + } + else + data->imeWnd = def;
So what happens to the window if the first IMC is destroyed? -- Alexandre Julliard julliard(a)winehq.org