#include once "window9.bi"

Function GetTextTreeView(ByVal gadget As Long, ByVal item As Integer) As USTRING Export
	Dim TV_ITEM_ As TV_ITEM
	#ifdef UNICODE
		Dim As USTRING sRet = wspace(256)
		TV_ITEM_.pszText= cast(any ptr , *sRet)	
	#else	
		Dim As String*256 sRet
		TV_ITEM_.pszText=Cast(LPSTR,StrPtr(sRet))  	
	#EndIf
	TV_ITEM_.cchTextMax=256
	TV_ITEM_.mask=TVIF_TEXT
	TV_ITEM_.hItem=Cast(HTREEITEM,item)
	SendMessage(GadgetID(gadget),TVM_GETITEM,0,cast(LPARAM,@TV_ITEM_))
	Return sRet
End Function
