user32: static controls should have a clipping region set while sending the WM_CTLCOLORSTATIC (patch)

Alexandre Julliard julliard at winehq.org
Fri Aug 24 04:44:44 CDT 2007


"Mikolaj Zalewski" <mikolajz at google.com> writes:

> +static void setup_clipping(HWND hwnd, HDC hdc)
> +{
> +    RECT rc;
> +    HRGN hrgn;
> +    
> +    /* Native control has always a clipping region set when sending
> +     * the WM_CTLCOLORSTATIC and an application depends on it
> +     */
> +    GetClientRect(hwnd, &rc);
> +    hrgn = CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom);
> +    if (GetClipRgn(hdc, hrgn) == 0)
> +        SelectClipRgn(hdc, hrgn);
> +    DeleteObject(hrgn);
> +}

You need to set the region in all cases, intersecting with the
existing one if any. Also you need to restore the previous region
after painting.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list