#include once "window9.bi"

Sub SetTextColumnListView(ByVal gadget As Long, _
								ByVal Column As Long, _
								ByRef txt    As USTRING)  Export
	dim As LVColumn ListViewColumn
	with ListViewColumn
		.mask       = LVCF_TEXT
		#ifdef UNICODE
			.pszText    = cast(any ptr , *txt)
		#else	
			.pszText    = StrPtr(txt)
		#EndIf
		.cchTextMax = Len(txt)
	end With
	If GetClassName_(GadgetID(gadget)) = "ExplorerGadget" Then
		SendMessage(GetProp(GadgetID(gadget),"EXPLORERGADGETLISTVIEWWINDOW"),LVM_SETCOLUMN, CInt(Column) ,Cast(LPARAM,@ListViewColumn))
	Else
		SendMessage(GadgetID(gadget),LVM_SETCOLUMN, CInt(Column) ,Cast(LPARAM,@ListViewColumn))
	EndIf
End Sub
