#include once "window9.bi"

Sub SetImageGadget(ByVal gadget As long, ByVal imageID As HBITMAP) Export
	Dim as USTRING cn = GetClassName_(GadgetID(gadget))
	If cn="Button" Then
		SendMessage(GadgetID(gadget),BM_SETIMAGE, 0,Cast(LPARAM,imageId))
	ElseIf cn="Static" Then
		SendMessage(GadgetID(gadget),STM_SETIMAGE, 0,Cast(LPARAM,imageId))
	EndIf
End Sub
