imm32: there is only 1 default Hwnd per thread

Alexandre Julliard julliard at winehq.org
Tue Sep 25 13:38:47 CDT 2012


Aric Stewart <aric at 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 at winehq.org



More information about the wine-devel mailing list