Hi, anyone kwnows how to add a text to a toolbar button, in the api referece is mentioned the istring member of TBBUTON struct, can anyone tell me how can i use it? Tnx
Posted on 2000-11-27 13:46:00 by trubrer
One way (already defined toolbar buttons) .DATA ;Double-null terminated string StrList db "Button&1",0,"Button&2",0,"Button&3",0,"Button&4",0,0 hWndTB HWND 0 .code ;... invoke SendMessage, hWndTB, TB_ADDSTRING, 0,offset StrList ;Or use Procstart.exe and generate code with checked "Use Toolbar" in Tbmacros.inc U can define e.c.: .DATA tbb TBBUTTON .... TB_hasTEXT_button MACRO bID, cID mov tbb.iBitmap, bID ;; button ID number mov tbb.idCommand, cID ;; command ID number mov tbb.fsStyle, TBSTYLE_BUTTON .if dwStyle & TBSTYLE_LIST ;List-style Tbar mov tbb.iString,bID add tbb.fsStyle,TBSTYLE_AUTOSIZE+BTNS_SHOWTEXT .endif invoke SendMessage,hWndTB,TB_ADDBUTTONS,1,addr tbb ENDM Also, Ican recommend to look through C prog BarSDI: http://msdn.microsoft.com/library/psdk/shellcc/commctls/Samples/toolbar/Barsdi/Barsdi.htm G'luck
Posted on 2000-11-27 16:51:00 by AndyCar
thanks a lot
Posted on 2000-11-28 03:19:00 by trybrer
P.S. Some newer ToolBar constants may not be present in Windows.inc (Hint: use h2inc to translate 'em to your .inc from Commctrl.h - (Can be found Ms Platform SDK)
Posted on 2000-11-28 14:04:00 by AndyCar