#include once "window9.bi"

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