#include once "window9.bi"

Function AddComboBoxImageItem Alias "AddComboBoxImageItem" (ByVal gadget As Integer, ByVal string_ As String,ByVal IDImage_ As HBITMAP,ByVal pos_ As integer) As Integer Export
  Dim CBITEM As COMBOBOXEXITEM
  Dim As Integer ppoos=ImageList_Add(Cast(HIMAGELIST,GetHimageCombo_(gadget)),Cast(HBITMAP,IDImage_),0)
  CBITEM.pszText        = Cast(LPSTR,StrPtr(string_))
  CBITEM.iItem          = pos_
  CBITEM.iImage         = ppoos
  CBITEM.iSelectedImage = ppoos
  CBITEM.cchTextMax     = Len(string_)
  CBITEM.mask           = CBEIF_TEXT or CBEIF_IMAGE or CBEIF_SELECTEDIMAGE  
  Var send_=SendMessage(Cast(HWND,GadgetID(gadget)) , CBEM_INSERTITEM, 0, Cast(LPARAM,@CBITEM))
  DeleteObject(Cast(HGDIOBJ,ppoos))
  Return send_
End Function
