Toolbar background error

Gerard Patel gerard.patel at nerim.net
Fri Aug 17 14:53:46 CDT 2001


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 ?

Gerard





More information about the wine-devel mailing list