#include once "window9.bi"

Sub SetComboBoxItemText(ByVal gadget As Long, ByRef txt As USTRING, ByVal Item As Long) Export
	#ifdef UNICODE
		Dim As LRESULT res=SendMessage(Cast(HWND,GadgetID(gadget)),CB_INSERTSTRING ,CInt(item) ,Cast(LPARAM,*txt))
	#else	
		Dim As LRESULT res=SendMessage(Cast(HWND,GadgetID(gadget)),CB_INSERTSTRING ,CInt(item) ,Cast(LPARAM,StrPtr(txt)))
	#EndIf
	If res<>CB_ERR Then
		SendMessage(Cast(HWND,GadgetID(gadget)),CB_DELETESTRING ,CInt(item)+1 ,0) 
	EndIf
End Sub
