Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29298 Discussions

Problem with loading icons to a list view

michael_green
Beginner
410 Views

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

0 Kudos
0 Replies
Reply