Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Need Toolbar Help! (win32 API)

This topic is 6018 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
Ok - I figured it out! I had to change the background
color of the *frame* window. Originally I had it set
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

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

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!