#include once "window9.bi"

Function GetCountTabRebarGadget(ByVal gadget As Long) As Integer Export
	Return SendMessage(GadgetID(gadget),RB_GETBANDCOUNT,0, 0)
End Function

Function GetHeightRebarGadget(ByVal gadget As Long) As Integer Export
	Return SendMessage(GadgetID(gadget),RB_GETBARHEIGHT,0, 0)
End Function

#ifdef UNICODE
	Function GetTextRebarGadget(ByVal gadget As long, ByVal index As Long) As USTRING Export
		Dim As REBARBANDINFO rbBand
		dim as USTRING wsRet = WSPACE(256)
		rbBand.cbSize=sizeof(REBARBANDINFO)
		rbBand.fMask  = RBBIM_TEXT
		rbBand.lptext = cast(any ptr , *wsRet)
		rbBand.cch=256
		SendMessage(GadgetID(gadget),RB_GETBANDINFO,cast(WPARAM,CInt(index)),cast(LPARAM,@rbBand))
		Return wsRet
	End Function	
#else	
	Function GetTextRebarGadget(ByVal gadget As long, ByVal index As Long) As USTRING Export
		Dim As REBARBANDINFO rbBand
		Dim As USTRING*256 sTemp
		rbBand.cbSize=sizeof(REBARBANDINFO)
		rbBand.fMask  = RBBIM_TEXT
		rbBand.lptext = Cast(LPTSTR,@sTemp)
		rbBand.cch=256
		SendMessage(GadgetID(gadget),RB_GETBANDINFO,cast(WPARAM,CInt(index)),cast(LPARAM,@rbBand))
		Return sTemp
	End Function	
#EndIf

