Maybe I am stupid, but I can't use TBBUTTON.dwData field.
I set it to some value before using TB_ADDBUTTONS (the same with TB_INSERTBUTTON), but when I try to extract parameters with TB_GETBUTTON this field is NULL!

Please someone to help. :)
Regards
Posted on 2003-10-09 02:51:14 by JohnFound
OK, I fixed it. The problem was in description of TBBUTTON in my help files (and in FASM include files too.)

If it is interesting for someone, the proper definition have 2 more bytes for alignment:
struc TBBUTTON

{
.iBitmap dd ?
.idCommand dd ?
.fsState db ?
.fsStyle db ?
.resword dw ? ; for dword alignment
.dwData dd ?
.iString dd ?
}


Regards
Posted on 2003-10-09 03:32:11 by JohnFound
This is how I do it, works fine...
tbrbtns	TBBUTTON <1, IDC_TBOPEN, TBSTATE_ENABLED,TBSTYLE_BUTTON, 0, [b]99[/b], 0>


in the WM_COMMAND handler
LOCAL tbbi :TBBUTTONINFO

.ELSEIF uMsg == WM_COMMAND
mov tbbi.cbSize,SIZEOF TBBUTTONINFO
mov tbbi.dwMask,TBIF_LPARAM
invoke SendMessage,hToolBar,TB_GETBUTTONINFO,wParam,ADDR tbbi
; dwData is in tbbi.lParam
Posted on 2003-10-09 03:38:08 by donkey