|
Support
ActiveX / COM
Visual C++ / MFC
Customer Spotlight
Corporate Partners
Contact Sales
Call center available M-F 9:00 - 6:00 US Eastern Time. U.S. and Canada International Email |
Using 24-bit Color Toolbars
Author: Kirk Stowell
Posted: November 16, 2004
Environment: Visual C++ MFC
Downloads:
If you want to add hot toolbar buttons like the ones seen in internet explorer, it is pretty straight forward. This approach will work for both Visual C++ 5 and 6, however you may want to read up on the enhancements to the toolbar class for VC 6.0.
After your toolbar has been created in
// Set up hot bar image lists. CImageList imageList; CBitmap bitmap;
// Create and set the normal toolbar image list. bitmap.LoadBitmap(IDB_TOOLBAR_COLD); imageList.Create(21, 20, ILC_COLORDDB|ILC_MASK, 13, 1); imageList.Add(&bitmap, RGB(255,0,255)); m_hotToolBar.SendMessage(TB_SETIMAGELIST, 0, (LPARAM)imageList.m_hImageList); imageList.Detach(); bitmap.Detach();
// Create and set the hot toolbar image list. bitmap.LoadBitmap(IDB_TOOLBAR_HOT); imageList.Create(21, 20, ILC_COLORDDB|ILC_MASK, 13, 1); imageList.Add(&bitmap, RGB(255,0,255)); m_hotToolBar.SendMessage(TB_SETHOTIMAGELIST, 0, (LPARAM)imageList.m_hImageList); imageList.Detach(); bitmap.Detach();
The send message portion of the code has been wrapped into a |

