- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I want to be able to load a series of different icons to the rows of a report-style list view. I'm creating them on the fly from a corresponding set of bit maps. The bit maps are all different, as appropriate, but despite the fact that I'm converting them to icons in a loop and (I think) loading them to the correct row of the list view, I only ever get to see the first icon repeated on every row, and none of the others at all. Here's the code:
iret = DeleteObject(hList)
hList = ImageList_Create(21,14,ILC_COLOR,clcount,99)
k = 0
do i = 1,clcount
fullname = trim(fmis$work)//''//BitMapName(i)//'.bmp'//char(0)
iret = DeleteObject(hImage)
hImage = LoadImage(0,fullname,IMAGE_BITMAP,21,14,LR_LOADFROMFILE)
iconinfo%ficon = .true.
iconinfo%hbmMask = hImage
iconinfo%hbmColor = hImage
iret = DeleteObject(hIcon)
hIcon = CreateIconIndirect(iconinfo)
iret = ImageList_ReplaceIcon(hList,-1,hIcon)
iret = SendMessage(hWndList,LVM_SETIMAGELIST,LVSIL_SMALL,hList)
item%iItem = k
temp = CodeList(i)//char(0)
item%isubitem = 0
item%psztext = loc(temp)
item%cchTextMax = 2
iret = SendMessage(hWndList,LVM_INSERTITEM,1,loc(item))
temp = trim(DescList(i))//char(0)
item%isubitem = 1
item%psztext = loc(temp)
item%cchTextMax = 39
iret = SendMessage(hWndList,LVM_SETITEM,2,loc(item))
k = k + 1
end do
The successive values that ImageList_ReplaceIcon returns are 0,1,2, etc, so it appears that I am adding images to the growing list. Can anyone suggest why I can't see the whole image list in my list view?
With many thanks in advance,
Mike
Link Copied

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page