?
Danke Euch beiden für die Hilfe.
So funktioniert es.
Gruss,
Thomas
void tb_add_button(HWND hwnd_toolbar, int command, int bitmap_name, char* text, int style = TBSTYLE_BUTTON)
{
TBBUTTON tbbutton; //Create TBBUTTON-Structur for saving infos about button which is to add
tbbutton.iBitmap = bitmap_name;
tbbutton.idCommand = command; //Command-Parameter to Command-Message to recognize clicks on Toolbar-Button
tbbutton.fsState = TBSTATE_ENABLED;
tbbutton.fsStyle = style;
tbbutton.dwData = 0;
tbbutton.iString = NULL;
SendMessage(hwnd_toolbar, TB_ADDBUTTONS, (WPARAM) 1, (LPARAM) (LPTBBUTTON) &tbbutton);
SendMessage(hwnd_toolbar, TB_ADDSTRING, (WPARAM) 1, (LPARAM) "0");
TBBUTTONINFO tbbi;
ZeroMemory(&tbbi, sizeof(tbbi));
tbbi.cbSize = sizeof(tbbi);
tbbi.dwMask = TBIF_SIZE;
tbbi.cx = 200;
SendMessage(hwnd_toolbar, TB_SETBUTTONINFO, (WPARAM)command, (LPARAM)&tbbi);
TBBUTTONINFO tbbi1;
ZeroMemory(&tbbi1, sizeof(tbbi1));
tbbi1.cbSize = sizeof(tbbi1);
tbbi1.dwMask = TBIF_TEXT;
tbbi1.pszText = text;
SendMessage(hwnd_toolbar, TB_SETBUTTONINFO, (WPARAM)command, (LPARAM)&tbbi1);
}
int WINAPI WinMain(...)
{
tb_add_button(hwnd_toolbar,2, 6, "Create a new dataset",0);
tb_add_button(hwnd_toolbar,1, 8, "Copy to clipboard", 0);
}