Jump to content
  • Advertisement
Sign in to follow this  
Kryptus

How do I put custom bitmaps on my toolbar buttons?

This topic is 4992 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 put custom bitmaps on my toolbar buttons? I have created a standard toolbar with a few buttons using Win32 API. I can use the standard images such as STD_FILENEW but how do I use a custom bitmap? I tried replacing STD_FILENEW with MAKEINTRESOURCE(IDB_MAIN) but it only displayed a blank button!

Share this post


Link to post
Share on other sites
Advertisement
Codeguru.com has a ton of articles and examples on how to do stuff like that.

http://codeguru.com/Cpp/controls/toolbar/

Share this post


Link to post
Share on other sites
There's three other methods:
1) Send the toolbar a TB_ADDBITMAP message (check MSDN for details) and then use the index returned in the TBBUTTON structure passed in the TB_ADDBUTTONS message.
2) Create an Imagelist and send TB_SETIMAGELIST to assign the list to the toolbar then use the bitmap index in the TBBUTTON as above.
3) Use CreateToolbarEx. This is an obsolete function but still works as far as I know.

Skizz

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!