#Include once "window9.bi"

Function ButtonImageGadget Alias "ButtonImageGadget" (ByVal gadget As Integer, ByVal x As Integer,ByVal y As Integer,ByVal Width_ As Integer,ByVal height_ As Integer,ByVal imageId As Integer=0, ByVal Style As Integer=BS_BITMAP) As HWND Export
  Var wnd = CreateWindowEx( 0, "Button", 0, WS_VISIBLE Or WS_CHILD Or Style, x, y, Width_, Height_, Cast(HWND,GETGURRENTAL()), Cast(HMENU,gadget), 0, 0)
  If imageId<>0 Then
    SendMessage(wnd,BM_SETIMAGE, 0,Cast(LPARAM,imageId))
  EndIf
  ADDIN9999(gadget,wnd)
  Return wnd
End Function
