[PATCH] user32: Don't draw a close button if it doesn't exist.

Alexandre Julliard julliard at winehq.org
Tue Oct 30 04:47:59 CDT 2018


Zhiyi Zhang <zzhang at codeweavers.com> writes:

> @@ -892,10 +892,12 @@ static void  NC_DrawCaption( HDC  hdc, RECT *rect, HWND hwnd, DWORD  style,
>          hSysMenu = GetSystemMenu(hwnd, FALSE);
>          state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND);
>  
> -        /* Draw a grayed close button if disabled or if SC_CLOSE is not there */
> -        NC_DrawCloseButton (hwnd, hdc, FALSE,
> -                            (state & (MF_DISABLED | MF_GRAYED)) || (state == 0xFFFFFFFF));
> -        r.right -= GetSystemMetrics(SM_CYCAPTION) - 1;
> +        /* Draw a grayed close button if disabled */
> +        if (state != 0xFFFFFFFF)
> +        {
> +            NC_DrawCloseButton (hwnd, hdc, FALSE, state & (MF_DISABLED | MF_GRAYED));
> +            r.right -= GetSystemMetrics(SM_CYCAPTION) - 1;
> +        }

This doesn't seem to match the Windows behavior. Why do you need this?

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list