#include once "window9.bi"

Sub SetListBoxItemText(ByVal gadget As long, ByRef txt As USTRING, ByVal Item As long) Export
	#ifdef UNICODE
		Dim As LRESULT res = SendMessage(Cast(HWND,GadgetID(gadget)),LB_INSERTSTRING ,item , Cast(LPARAM,*txt))
	#else
		Dim As LRESULT res = SendMessage(Cast(HWND,GadgetID(gadget)),LB_INSERTSTRING ,item , Cast(LPARAM,StrPtr(txt)))
	#EndIf   
	If res<>LB_ERR Then
		SendMessage(Cast(HWND,GadgetID(gadget)),LB_DELETESTRING ,item+1 ,0)
	EndIf
End Sub
