I have a listview with icons (generated in/with imagelist).
Now I want to remove the icons from listview and I use:

invoke SendMessage, listview, LVM_SETIMAGELIST, LVSIL_SMALL, 0 ;imagelisthandle = 0 = remove icons

Works perfect, the icon were removed. But the places, where the icons were before, are still there !?
How can I remove the icons and the free iconplaces ?

Sorry for my bad english. I hope, you could understand me...

Posted on 2004-04-18 07:43:46 by Nordwind64

couldn't you understand me or is there no solution ?

Best regards,
Posted on 2004-04-18 13:44:09 by Nordwind64
Perhaps you need to iterate through each item, and remove image flag from each LV_ITEM?
Posted on 2004-04-18 13:45:18 by comrade
Thanks, comrade !

I tried it, but it don't work.
How to REMOVE image flag ? I tried 0 and -1 in iImage...

Posted on 2004-04-19 10:34:32 by Nordwind64
There is a LVITEM struct member called iIndent, perhaps that's what you're looking for...

Posted on 2004-04-19 10:57:57 by QvasiModo
Hi QvasiModo,

cool, thanks !!!
But sorry, could not erase the place where the icon was before.

Posted on 2004-04-19 14:04:26 by Nordwind64
Looks like you have to recreate the listview...
Posted on 2004-04-20 05:58:20 by Vaxon
Thanks you Vaxon.

Seems, you're right. Grrr...

Thanks !!!
Posted on 2004-04-20 10:48:46 by Nordwind64
Your problem seems very mutch related to my experiances with listview controls.

When you created the listview, is it a virtual list view? Look if it isn't then the listview retains a chace filled with display info... and the buffer doesn't seem to get flushed at any point {enumerating and browsing through my machine... and my app's memmory keeps on increasing}

As far as i know, if a virtaul listview is created and the display of the listview is updated then an item query is sent to retrieve the image indexs and image text.

So if you empty out all your images from the imagelist and refresh the contents of your listview, then each item will query for the text and imageindex fields.

And so you can remove the images (at least as i understand it - still busy with it myself) without recreating the whole listview control.

Black iCE
Posted on 2004-04-21 03:43:27 by Black iCE
Oops, my blunder... i miss read your question.

Recreate each listview item and DONT add in the LVIF_IMAGE into LVITEM.

{try combining it with my previous post}
Posted on 2004-04-21 03:48:47 by Black iCE
Thanks, Black iCE

I will try it tomorrow.
It is not a virtual listview !

Posted on 2004-04-21 15:08:20 by Nordwind64

found a simple solution !!!

invoke ImageList_SetIconSize,ilist&,0,GetSystemMetrics(50)

Posted on 2004-04-24 06:24:45 by Nordwind64