I have created MFC based application Visual Studio 2010 Professional Edition, where I have created my own class(CMToolBar) derive from CToolbar and I am using the CMToolbar class object in a dialog based application.
In its create function , by default I am trying to disable the states of few buttons, but as soon I used the code such as :-
GetToolBarCtrl().EnableButton(ID_ONE,false);
or
this->SendMessage(TB_ENABLEBUTTON,ID_ONE, (LPARAM)MAKELONG(FALSE, 0));
it will disable the button in both the cases ,including the icon is not showing also, where icon image should be grey out.
Secondly if user click second toolbar button, I am calling the code such as :-
GetToolBarCtrl().SetState(ID_TWO,TBSTATE_PRESSED); // where ID_TWO is the id of second button
as per above function the button should be in pressed state, but in my case its not changing the state of that button either.