Toolbar background error

Bill Medland medbi01 at
Fri Aug 17 09:33:13 CDT 2001

Gerard Patel <gerard.patel at> wrote in article
< at>...
> At 05:10 PM 16/08/2001 GMT, you wrote:
> >It's the client rectangle in the toolbar (I believe).  I've handed the
> >issue back to Guy.
> I think that's a general issue, not specific to toolbars. 
> We are seeing it for toolbars because it's a trick that is used mainly
> for toolbars.
> What happens I think is that some apps are not satisfied with the
> toolbar look. They want to have a bigger border around the buttons. 
> That is not provided by the standard control, at least when these apps
> were written (maybe it is now, I am not following these matters closely).

> What these apps are doing is playing with WM_NCCALCSIZE to restrict
> the client rectangle to something smaller than what remains when 
> the system clips the true nonclient area. In the case of one of my test
> apps, this is done by subclassing (the Wine code is never called).
> Since GetWindowRect returns only the width and the height of the
> client area, and is setting the origin to 0 - 0, the custom client area
> appears higher that it is to WM_ERASEBKGND and the lower part of
> the window is not painted (toolbar in the case of the app I see)
> Now, I don't know yet how should be done the erasing of this custom
> nonclient area :-/
> Gerard
Now that makes sense to me.  The example I am working with is the MSDN
ROWLIST sample which is unfortunately MFC  (I prefer using Petzold examples
because that is purer code).

According to Spy++ I saw the NC_CALCSIZE calls happening on windows.  (The
messages during the Toolbar creation during the main window creation are:
WM_CREATE for the main application windows

Now spy++ tells me that the Client Rectangle is (8,5) to (208, 27) (which
as far as I understand is measured relative to the innermost pixel of the
application window border inclusive of it).

So how does an application modify the location of the client rectangle
after it has been created?


More information about the wine-devel mailing list