nur die standard icons verwendet werden.
Code: Alles auswählen
Procedure ToolBar_AddButton(hToolbar, id.L, text.S, Image.L)
*p = AllocateMemory(Len(text)+2)
PokeS(*p, text)
PokeB(*p + Len(text) + 1, 0)
PokeB(*p + Len(text) + 2, 0)
idString.L = SendMessage_(hToolbar, #TB_ADDSTRING, $0, *p)
btn.TBBUTTON
btn\idCommand = id
btn\iBitmap = Image
btn\fsState = #TBSTATE_ENABLED
btn\fsStyle = #BTNS_BUTTON | #BTNS_AUTOSIZE | #BTNS_SHOWTEXT
btn\iString = idString
btncount.L = SendMessage_(hToolbar, #TB_BUTTONCOUNT, $0, $0)
SendMessage_(hToolbar, #TB_INSERTBUTTON, btncount+1, @btn)
EndProcedure
