Need Toolbar Help! (win32 API)

Started by
3 comments, last by bartyount 21 years, 9 months ago
I''ve got a problem with a toolbar in my win32 app. Hopefully someone out there can help! I created the toolbar and it appears on my frame window no problem. The problem comes in when I try to use the TBSTYLE_FLAT style to make the buttons look non-3D until you place the mouse over the button in which case it sort of highlites (you know what I mean - most current windows apps have this style). The problem is that when using the flat style, the toolbar appears transparent, showing the background of the frame (dark gray). (I''m not using TBSTYLE_TRANSPARENT, so that''s not the problem). I tried creating a light gray (same color as the frame) static style window underneath the toolbar which appeared to work initially because the toolbar background was the right color. But as soon as you place the mouse over the button it turns to the dark gray (background) color again and stays that way. Anyone know how to fix this? I''ve looked on the net for the last 2 days looking for the answer, but can''t find anything. There were a few threads here on the subject, but the threads never ended in the solution. BTW, I''m only using the win32 API - not MFC. Thanks in advance for any help!!! Bart
Advertisement
Did you set the background color of the toolbar?

In all honesty, I despise developing Windows GUIs in C or C++ (MFC, WTL, Win32 - whatever!) If you have other alternatives for the GUI as a front end (VB, .Net languages...), I''d advise that you try them instead.
How do you set the background color?

I used the CreateWindowEx function with
TOOLBARCLASSNAME as the window class.
I assume the background color would be
specified in this pre-defined class.

I could just create my own class, but
I don''t know what settings to use to
get the toolbar.
You may find this site helpfull if you are trying to avoid MFC :

http://www.foosyerdoos.fsnet.co.uk/

/Please excuse my bad spelling - My native language is binary not english
|Visit me
\Take my advice - I don''''t use it...
/Please excuse my bad spelling - My native language is binary not english|Visit meTake my advice - I don''t use it...
Ok - I figured it out! I had to change the background
color of the *frame* window. Originally I had it set
to (HBRUSH) (COLOR_APPWORKSPACE+1). I got that
from Petzold. When I changed the background to
(HBRUSH)(COLOR_BTNFACE+1) which I got from
http://www.foosyerdoos.fsnet.co.uk/, it fixed my
problem!

Thanks for the help Oluseyi and thanks for the link, guppy!
I''ve bookmarked that site for future reference - it was very helpful!

This topic is closed to new replies.

Advertisement