Toolbar background error

Marcus Meissner marcus at jet.franken.de
Fri Aug 17 14:49:06 CDT 2001


On Fri, Aug 17, 2001 at 07:53:46PM +0000, Gerard Patel wrote:
> At 02:33 PM 17/08/2001 GMT, you wrote:
> 
> <snip>
> >So how does an application modify the location of the client rectangle
> >after it has been created?
> 
> By changing rgrc[0] when responding to WM_NCCALCSIZE.
> It seems that it is only possible to erase properly the 'custom' nonclient
> area by using GetWindowDC... So :
> 
> --- defwnd.c.orig       Sat Aug 11 10:23:18 2001
> +++ defwnd.c    Fri Aug 17 19:47:17 2001
> @@ -462,8 +462,12 @@
>              if (!hbr) return 0;
>  
>              /* GetClientRect used to be GetClipBox, but it is not what
> -             * Windows does, and it breaks badly with CS_PARENTDC */
> -            GetClientRect( wndPtr->hwndSelf, &rect );
> +             * Windows does, and it breaks badly with CS_PARENTDC
> +             * GetClientRect breaks too when we are called with a window
> +             * DC (!!) - what next ? */
> +            rect.left = rect.top = 0;
> +            rect.right = wndPtr->rectWindow.right - wndPtr->rectWindow.left;
> +            rect.bottom = wndPtr->rectWindow.bottom - wndPtr->rectWindow.top;
>              DPtoLP( hdc, (LPPOINT)&rect, 2 );
>              FillRect( hdc, &rect, hbr );
>             return 1;
> 
> What do you think ?

I suggest reading the Corel CVS for this part of the code.

They rewrote this part like _5_ times.

Ciao, Marcus




More information about the wine-devel mailing list