hey, now i have made tool bar .. but oh there is 5 buttons as i require but those are empty there is no bitmap visible.. how can do make tool bar with bitmap..
You can view gif print of error.. here..
http://www.geocities.com/innocent4nu/toolbar.GIF
i use the following code to make and load bitmap..
case WM_CREATE:
InitCommonControls();
LoadBitmap(ghInstance,MAKEINTRESOURCE(IDR_TOOLBAR1));
ghToolBar = CreateWindowEx(
NULL,
TOOLBARCLASSNAME,
NULL,
WS_CHILD | WS_VISIBLE,
0, 0,
0, 0,
hwnd, (HMENU)IDR_TOOLBAR1,
ghInstance,
NULL);
SendMessage(ghToolBar, TB_BUTTONSTRUCTSIZE, (WPARAM)
sizeof(TBBUTTON), (LPARAM)NULL);
tbAddBitmap.hInst = ghInstance;
tbAddBitmap.nID = IDR_TOOLBAR1;
SendMessage(ghToolBar, TB_ADDBITMAP, 6, (LPARAM) &tbAddBitmap);
ZeroMemory(tbButton, sizeof(tbButton));//fills a block of
memory with zeros.
tbButton[0].iBitmap = 0;
tbButton[0].fsState = TBSTATE_ENABLED;
tbButton[0].fsStyle = TBSTYLE_BUTTON;
tbButton[0].idCommand = ID_BUTTON40006;
tbButton[1].iBitmap = 1;
tbButton[1].fsState = TBSTATE_ENABLED;
tbButton[1].fsStyle = TBSTYLE_BUTTON;
tbButton[1].idCommand = ID_BUTTON40007;
tbButton[2].fsStyle = TBSTYLE_SEP;
tbButton[3].iBitmap = 2;
tbButton[3].fsState = TBSTATE_ENABLED;
tbButton[3].fsStyle = TBSTYLE_BUTTON;
tbButton[3].idCommand = ID_BUTTON40008;
tbButton[4].iBitmap = 3;
tbButton[4].fsState = TBSTATE_ENABLED;
tbButton[4].fsStyle = TBSTYLE_BUTTON;
tbButton[4].idCommand = ID_BUTTON40010;
tbButton[5].fsStyle = TBSTYLE_SEP;
tbButton[6].iBitmap = 4;
tbButton[6].fsState = TBSTATE_ENABLED;
tbButton[6].fsStyle = TBSTYLE_BUTTON;
tbButton[6].idCommand = ID_BUTTON40011;
sendMessage(ghToolBar, TB_ADDBUTTONS, 7, (LPARAM) &tbButton);
break;