#include once "window9.bi"

Dim Shared As HFONT g_FONT
Function SetGadgetFont(ByVal gadget As Long, ByVal Font As integer) as integer Export
	If gadget=-1 And font=-1 Then
		g_FONT = 0
	ElseIf gadget=-1 Then
		g_FONT = Cast(HFONT,Font)
	Else
		If GetClassName_(GadgetID(gadget)) = "ExplorerGadget" Then
			Return SendMessage(GetProp(GadgetID(gadget),"EXPLORERGADGETLISTVIEWWINDOW"),WM_SETFONT,Cast(WPARAM,font),0)
		else
			Return SendMessage(GadgetID(gadget),WM_SETFONT,Cast(WPARAM,font),0)
		End If
	End If
End Function

Function win9GetGadgetFont() As integer Export
	Return cast(integer,g_FONT)
End Function
