I'm not really sure where I'm going wrong here.
I'll post my relevant code sections on here in the hope that someone can point me in the right direction.
I'll use standard buttons to make it simpler
First of all, here is my simple button structure
Code:
TBBUTTON StdButtons [NUM_BUTTONS] =
{
/* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */
{STD_FILENEW, ID_NEW, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0, 0},
{STD_FILEOPEN, ID_OPEN, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
{STD_FILESAVE, ID_SAVE, TBSTATE_INDETERMINATE, BTNS_BUTTON, {0}, 0, 0},
};
Next I create my floating toolbar using WS_EX_TOOLWINDOW which successfully returns the handle hFloatTool.
Then I attempt send the images to the toolbar
Code:
/* Send the TB_BUTTONSTRUCTSIZE message, which is required for backward compatibility */
SendMessage(hFloatTool, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
/* Add standard images */
tbab.hInst = HINST_COMMCTRL;
tbab.nID = IDB_STD_SMALL_COLOR;
iImageOffset = (INT)SendMessage(hFloatTool, TB_ADDBITMAP, NUM_BUTTONS, (LPARAM)&tbab);
/* Add buttons to toolbar */
SendMessage(hFloatTool, TB_INSERTBUTTON, iImageOffset, (LPARAM) &StdButtons);
/* Show toolbar */
ShowWindow(hFloatTool, SW_SHOW);
When run, I just get a blank floating toolbar.
Any ideas?
Cheers.