Adding a bitmap to a toolbar button why isn't this working?
Code:
TBBUTTON tbb[1];
TBADDBITMAP tbab;
tbab.hInst = HINST_COMMCTRL;
tbab.nID = IDB_STD_SMALL_COLOR;
SendMessage(mainTB, TB_ADDBITMAP, 0, (LPARAM)&tbab);
ZeroMemory(tbb, sizeof(tbb));
tbb[0].iBitmap = IDB_BGGBTN_GRAY; //this line for my button image (i think)
tbb[0].fsState = TBSTATE_ENABLED;
tbb[0].fsStyle = TBSTYLE_BUTTON;
tbb[0].idCommand = MAINTB_MAINMENU;
IDB_BGGBTN_GRAY is defined in my resource editor (VC++)
I added the file into my resources file, and named it IDB_BGGBTN_GRAY
but it doesn't show...
Does anyone know why?
Thanks
Re: Adding a bitmap to a toolbar button why isn't this working?
You must not use
Code:
tbab.hInst = HINST_COMMCTRL;
unless you want to use a system bitmap. Use the application's HINSTANCE or the HINSTANCE of a .dll depending on where the resource is located.