
transparent bitmap on toolbar button
You'll need to create an image list. See TB_SETIMAGELIST, ImageList_Create,
ImageList_Add, ImageList_AddMasked
--
With best wishes,
Igor Tandetnik
Hi
As subject says I'm trying to make the bitmap have a transparent background
on my
toolbar button. I imagine this is done by either setting the mask color or
use an
overlay masks. Here is my source. Any help is appreciated.
Thanks ahead of time
TBADDBITMAP tbab;
TBBUTTON tbb[2];
hWndToolBar = CreateWindowEx (0,TOOLBARCLASSNAME, NULL,WS_CHILD |
WS_BORDER | WS_VISIBLE,0,0,0,0, hWndParent,(HMENU) ID_TOOLBAR, hInst,NULL);
SendMessage(hWndToolBar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
tbab.hInst = hInst;
tbab.nID = IDB_TOOLBAR_BITMAP;
tbb[0].iBitmap = 0;
tbb[0].fsState = TBSTATE_ENABLED;
tbb[0].fsStyle = TBSTYLE_BUTTON;
tbb[0].dwData = 0;
tbb[0].idCommand = CM_CONNECT_BUTTON;
tbb[1].iBitmap = 1;
tbb[1].fsState = TBSTATE_ENABLED;
tbb[1].fsStyle = TBSTYLE_BUTTON;
tbb[1].dwData = 0;
tbb[1].idCommand = CM_DISCONNECT_BUTTON;
SendMessage(hWndToolBar, TB_ADDBITMAP,2, (LPARAM)&tbab);
SendMessage(hWndToolBar, TB_ADDBUTTONS, 2, (LPARAM)&tbb);