#Include once "window9.bi"

Function ImageGadget Alias "ImageGadget" (ByVal gadget As integer, ByVal x As Integer,ByVal y As Integer,ByVal Width_ As Integer,ByVal height_ As Integer, _
                                          ByVal imageId As HBITMAP=0 , stil As Integer =0,Style As Integer = SS_BITMAP) As HWND Export
  Dim wnd As HWND
  If stil<>0 Then
    wnd= CreateWindowEx( WS_EX_CLIENTEDGE, "static", 0, SS_NOTIFY Or WS_CHILD Or WS_VISIBLE Or Style, x, y, Width_, Height_, GETGURRENTAL(), Cast(HMENU,gadget), 0, 0)
  Else
    wnd= CreateWindowEx( 0, "static", 0, SS_NOTIFY Or WS_CHILD Or WS_VISIBLE Or Style, x, y, Width_, Height_, GETGURRENTAL(), Cast(HMENU,gadget), 0, 0)
  EndIf
  If imageId<>0 Then
    SendMessage(wnd,STM_SETIMAGE, 0,Cast(LPARAM,imageId))
  EndIf
  ADDIN9999 (gadget,wnd)
  Return wnd
End Function