#include once "window9.bi"

Function GetButtonToolBarState(ByVal TBar As Integer,ByVal IdButton As Integer,ByVal flag As Integer) As Integer export
  Select Case flag
    Case 1
      Return SendMessage( Cast(HWND,TBar), 1034,Cast(WPARAM,IdButton) ,0) ' checked
    Case 2
      Var en=SendMessage( Cast(HWND,TBar), 1033,Cast(WPARAM,IdButton) ,0) 'disabled
      If en=1 Then 
        Return 0
      Else
        Return 1
      End If
    Case 3
      var h= SendMessage( Cast(HWND,TBar), 1036,Cast(WPARAM,IdButton) ,0) 'hidden
      If h<>0 Then
        Return 1
      Else
        Return 0
      End If
  End Select
End Function
