#include once "window9.bi"

Sub SetIconGadget(ByVal gadget As Long, ByVal icon As HICON) Export
	Dim As USTRING cn = GetClassName_(GadgetID(gadget))
	If cn="Button" Then
		SendMessage(GadgetID(gadget),BM_SETIMAGE, IMAGE_ICON,Cast(LPARAM,icon))
	ElseIf cn="Static" Then
		SendMessage(GadgetID(gadget),STM_SETIMAGE, IMAGE_ICON,Cast(LPARAM,icon))
	End If
End Sub
