//请将以下这段代码添加到CMainFrame::OnCreate函数中的最未尾处。
// 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(192,192,192)); // RGB(192,192,192)是Win98的按扭颜色
m_wndToolBar.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(192,192,192));
m_wndToolBar.SendMessage(TB_SETHOTIMAGELIST, 0, (LPARAM)imageList.m_hImageList);
imageList.Detach();
bitmap.Detach();
//Create and set the disable toolbar image list
bitmap.LoadBitmap(IDB_TOOLBAR_DISABLE);
imageList.Create(21, 20, ILC_COLORDDB|ILC_MASK, 13, 1);
imageList.Add(&bitmap, RGB(192,192,192));
m_wndToolBar.SendMessage(TB_SETDISABLEDIMAGELIST, 0, (LPARAM)imageList.m_hImageList);
imageList.Detach();
bitmap.Detach();
|