#Include once "window9.bi"

function SetIconGadget(ByVal gadget As integer, ByVal icon As HICON) As Integer Export
	Dim fbgui77 As String = GetClassName_(GadgetID(gadget))
	If fbgui77="Button" Then
		Return SendMessage(GadgetID(gadget),BM_SETIMAGE, IMAGE_ICON,Cast(LPARAM,icon))
	ElseIf fbgui77="Static" Then
		Return SendMessage(GadgetID(gadget),STM_SETIMAGE, IMAGE_ICON,Cast(LPARAM,icon))
	EndIf
End Function
