#include once "window9.bi"

Function SetListBoxItemText(ByVal gadget As Integer, ByVal string_ As String,ByVal Item As integer) As Integer Export
	Dim As LRESULT res=SendMessage(Cast(HWND,GadgetID(gadget)),LB_INSERTSTRING ,item ,Cast(LPARAM,StrPtr(string_)))
	If res<>LB_ERR Then
		Function=res
		If SendMessage(Cast(HWND,GadgetID(gadget)),LB_DELETESTRING ,item+1 ,0) = LB_ERR Then Return 0
	EndIf		
End Function
