#Include once "window9.bi"

Function SetButtonToolBarState(ByVal TBar as integer,ByVal IdButton As integer,ByVal flag As Integer,ByVal State As Integer) As Integer export
  Select Case flag
    Case 1
      Return SendMessage(Cast(HWND,TBar), 1026,Cast(WPARAM,IdButton) ,Cast(LPARAM,State))' check
    Case 2
      If state=1 Then 
        state=0
      Else
        state=1
      EndIf
      Return SendMessage(Cast(HWND,TBar), 1025,Cast(WPARAM,IdButton) ,Cast(LPARAM,State)) ' disabled
    Case 3
      Return SendMessage(Cast(HWND,TBar), 1028,Cast(WPARAM,IdButton) ,Cast(LPARAM,State)) ' hide  
  End Select
End Function
