Re: Help with Windows API ImageList_LoadImage needed
- Posted by euman at bellsouth.net Aug 20, 2003
- 919 views
On 20 Aug 2003 at 4:04, 1evan at sbcglobal.net wrote: > Using the following definitions, when I call ImageList_LoadImage, it > always gives me "Image not loaded." > Any ideas why? Do I not have something defined correctly? MyIcon.ico > is a 16x16 icon. > > ImageList_LoadImage = link_c_func(comctl, "ImageList_LoadImage", > {C_INT,C_POINTER,C_INT,C_INT,C_UINT,C_UINT,C_UINT},C_INT) > > CLR_DEFAULT = #FF000000 > > LR_LOADFROMFILE = #0010 > > Image = allocate_string("MyIcon.ico") > > if not > c_func(ImageList_LoadImage,{NULL,Image,16,1,CLR_DEFAULT,1,LR_LOADFROMFILE}) > then > puts(1,"Image not loaded" & '\n') > end if > Im not sure what you're doing here but Ive always loaded my ImageList like so: hImageList = c_func(xImageList_Create,{16,16,ILC_COLOR16,2,10}) hBitmap = LoadImage("image.bmp", IMAGE_BITMAP) junk = c_func(xImageList_Add,{hImageList,hBitmap,NULL}) c_proc(xDeleteObject, {hBitmap}) using standard LoadImage instead of ImageList_LoadImage This has always worked for me. Take a look at my EFFM project in the RDS archive... http://www.rapideuphoria.com/effm2.zip Treeview.ew loads a user created imagelist from file Hope this will help.. Euman