#include once "window9.bi"

Function GroupGadget(ByVal gadget As Long, _
					ByVal x As Long, ByVal y As Long, _
					ByVal w As Long, ByVal h As Long, _
					ByRef s As USTRING) As HWND Export
	#ifdef UNICODE
		Var hWin = CreateWindowEx(0, "Button", *s, &h50020007, x,y,w,h, win9GetCurrent(), Cast(HMENU,CInt(gadget)), 0, 0)
	#else	
		Var hWin = CreateWindowEx(0, "Button", s, &h50020007, x,y,w,h, win9GetCurrent(), Cast(HMENU,CInt(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
