Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Buttons of toolbar

andriasoa
Beginner
456 Views
How I can disable, enable or gray a button of a toolbar
during the program?
(I can do it during creation of the toolbar).
I have (T_TBBUTTON) TBbutton(21)
I try to use type SendMessage with one of the three following parameters :
TB_ENABLEBUTTON
TB_SETSTATE
TB_INDETERMINATE
No result
for example : to disable the button 2 of a toolbar
iret = SendMessage(hWndTB, TB_ENABLEBUTTON, 2, FALSE)
to gray the button 2 of a toolbar
iret = SendMessage(hwndTB, TB_INDETERMINATE, 2, TRUE)

iret = SendMessage(hWndTB, TB_SETSTATE , 2, MAKELONG(TBSTATE_INDETERMINATE, 0))
Thanks,
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
456 Views
wParam of TB_ENABLEBUTTON should be button ID (the same value you put in T_TBBUTTON.idCommand), not its index.
Jugoslav
0 Kudos
Reply