Toolbar with trucolor bitmap buttons
-
Actualy i have an error when toolbar.bmp have 256 or grater colors. WTL aplication just asserts on loading bitmap. how to create toolbar with "more colors", not with 16 color !? ---------------------------- never stop coding.
i do it only with editing atlframe.h i changed some code, if we are not in WIN_CE block [code] /* ATLASSERT(false); TBADDBITMAP tbab = { 0 }; tbab.hInst = hInst; tbab.nID = nResourceID; ::SendMessage(hWnd, TB_ADDBITMAP, nBmp, (LPARAM)&tbab); */ HBITMAP hBmp = LoadBitmap( hInst, MAKEINTRESOURCE(nResourceID) ); HIMAGELIST hImageList = ImageList_Create( pData->wWidth, pData->wWidth, ILC_COLOR32, pData->wItemCount, 0 ); ImageList_Add( hImageList, hBmp, (HBITMAP)NULL ); ::SendMessage(hWnd, TB_SETIMAGELIST, 0, (LPARAM)hImageList); [/code] ==================== maybe there is some other way ? :) ---------------------------- never stop coding.
-
i do it only with editing atlframe.h i changed some code, if we are not in WIN_CE block [code] /* ATLASSERT(false); TBADDBITMAP tbab = { 0 }; tbab.hInst = hInst; tbab.nID = nResourceID; ::SendMessage(hWnd, TB_ADDBITMAP, nBmp, (LPARAM)&tbab); */ HBITMAP hBmp = LoadBitmap( hInst, MAKEINTRESOURCE(nResourceID) ); HIMAGELIST hImageList = ImageList_Create( pData->wWidth, pData->wWidth, ILC_COLOR32, pData->wItemCount, 0 ); ImageList_Add( hImageList, hBmp, (HBITMAP)NULL ); ::SendMessage(hWnd, TB_SETIMAGELIST, 0, (LPARAM)hImageList); [/code] ==================== maybe there is some other way ? :) ---------------------------- never stop coding.