I use this code to make a "toolbar" but i need the "normal" toolbar .. with the same background as menu ...


Posted on 2002-09-08 18:50:52 by hunter
It is not a problem, it is a 'feature' :grin:. The TBSTYLE_FLAT style forces also a transparent background. There is an old post about that here:
The solution is to use a Rebar or, as suggested by KetilO (I hope to remember well :rolleyes: ), a static control as toolbar's parent.
Posted on 2002-09-09 03:04:13 by LuHa
where is the background ? not only in the buttons but in all the window :?
Posted on 2002-09-09 04:30:58 by hunter
anyone has a working example or a "how-to" about rebar + toolbar or other solutions ... its seems very strange to me that there is no way to make a "entire" toolbar with no transparent background ... :? other solutions?
Posted on 2002-09-09 05:37:53 by hunter
Posted on 2002-09-09 05:48:02 by LuHa
if i process the WM_SIZE MSG ..

invoke SendMessage,hToolBar,WM_SIZE,wParam,lParam

the toolbar is OK ... but all the window has the same background .. and i dont like so.

Im writing an MDI application ...

if i remove the WM_SIZE ... the window is OK but the toolbar isnt.
Posted on 2002-09-09 06:38:20 by hunter
how to add a toolbar to tut32.zip (MDI) of iczelion preserving colours and functionality?
Posted on 2002-09-09 07:02:25 by hunter
I'm almost sure that DefFrameProc really wants to process all your WM_SEZE messages, so make it happy and modify the message handling this way:

invoke SendMessage,hToolBar,WM_SIZE,wParam,lParam
invoke DefFrameProc,hWnd,hwndClient,uMsg,wParam,lParam

Invoking directly the DefFrameProc. I hope this will solve your problem.
Posted on 2002-09-09 07:10:44 by LuHa
i added this routine frmo the board:

invoke GetSysColorBrush ,COLOR_APPWORKSPACE
mov hBrushMainBack, eax

invoke BeginPaint,hWnd, addr ps
mov hdc, eax

invoke GetWindowRect, hToolBar, addr r
mov eax, r.bottom
sub eax, r.top
push eax
invoke GetClientRect, hWnd, addr r
pop r.top
invoke DrawEdge ,hdc, addr r, EDGE_SUNKEN, BF_RECT
inc r.top
inc r.left
dec r.right
dec r.bottom
inc r.top
inc r.left
dec r.right
dec r.bottom
invoke FillRect,hdc,addr r,hBrushMainBack

invoke EndPaint,hWnd,addr ps
mov eax, TRUE

see the result in attached file ... it works but ... the child windows doesnt appears .... :((( grrrrrrrr XD
Posted on 2002-09-09 07:15:31 by hunter
invoke DefFrameProc,hWnd,hwndClient,uMsg,wParam,lParam <- doesnt work ...

but very very thx for helping man ...
Posted on 2002-09-09 07:20:07 by hunter
ideas plz? ... im getting crazy
Posted on 2002-09-09 08:38:40 by hunter
Hum... You shouldn't need to paint the window (you are painting the window by yourself, aren't you?) with COLOR_APPWORKSPACE since the ClientWindow will cover all the free client area. Try reverting to the original source code of the tut 32 as much as possible, removing all the unneeded code.
Posted on 2002-09-09 08:52:15 by LuHa
the original tut32 doesnt have toolbar neither process WM_SIZE ... so dont problems there .. but i need to add a toolbar and i dont know how to add with background that fills the horizontal size of window and withouth affecting to client area wich is in COLOR_APPWORKSPACE colour.
Posted on 2002-09-09 10:36:11 by hunter

when building the window class use:
hbrBackground, COLOR_BTNFACE+1
Posted on 2002-09-09 11:26:43 by alpha
dont work ... the toolbar has no background (even with COLOR_BTNFACE+1) if NOT process the WM_SIZE and all the ..cking window has the same color as toolbar if process WM_SIZE as well the child windows doesnt appears.

Anyone has been able to add a toolbar to tut32 of iczelion and let it working?
Posted on 2002-09-09 11:51:18 by hunter