#include once "window9.bi"

Function AddListViewColumn(ByVal gadget As Long, ByRef string_ As USTRING, ByVal pos_ As Long,ByVal SubItem_ As Long,_
							ByVal width_Column As Long,ByVal Style_Column_TEXT As Long=LVCFMT_CENTER,_
							ByVal Style_Mask As Long=LVCF_FMT Or LVCF_SUBITEM Or LVCF_TEXT Or LVCF_WIDTH) As Long Export
	Dim As LVCOLUMN LVS9
	LVS9.mask       = Style_Mask
	LVS9.fmt        = Style_Column_TEXT
	LVS9.cx         = width_Column
	#ifdef UNICODE
			LVS9.pszText    = cast(any ptr ,*string_)
	#else	
			LVS9.pszText    = StrPtr(string_)
	#EndIf
	LVS9.cchTextMax = Len(string_)
	LVS9.iSubItem   = SubItem_
	return SendMessage(GadgetID(gadget),LVM_INSERTCOLUMN,pos_,Cast(LPARAM,@LVS9))  
End Function
