#include once "window9.bi"

Function TextGadget(ByVal gadget As Integer, _
					ByVal x As Integer, ByVal y As Integer, _
					ByVal w As Integer, ByVal h As Integer,_
					ByRef sWindowName As USTRING, _
					ByVal Style As Integer) As HWND Export
	
	#ifdef UNICODE
		Var hWin= CreateWindowEx( 0, "static", *sWindowName, WS_VISIBLE Or WS_CHILD Or Style, x,y,w,h, win9GetCurrent(), Cast(HMENU,gadget), 0, 0)
	#else	
		Var hWin= CreateWindowEx( 0, "static", sWindowName, WS_VISIBLE Or WS_CHILD Or Style, x,y,w,h, win9GetCurrent(), Cast(HMENU,gadget), 0, 0)
	#EndIf	
	win9AddNewGadget(gadget,hWin)
	win9AddColor(hWin,15790320,0)
	If win9GetGadgetFont()<>0 Then SendMessage(hWin, WM_SETFONT, win9GetGadgetFont(),0)
	Return hWin
End Function
