I created a listview with bitmaps based on an Imagelist and depending on whatever happend i want to change sometimes the
bitmap in somethin else so far so good.

As far as i understand LVM_GETNEXTITEM and LVM_GETITEM i tried somethin like this ..



:
:
invoke SendMessage,hListView,LVM_GETNEXTITEM,-1,LVNI_FOCUSED
mov lvi.iItem,eax
mov lvi.iSubItem,0
mov lvi.imask,LVIF_TEXT or LVIF_PARAM or LVIF_IMAGE
lea eax,sockbuffer
mov lvi.pszText,eax
mov lvi.cchTextMax,256
invoke SendMessage,hListView,LVM_GETITEM,0,addr lvi
inc lvi.iSubItem
mov lvi.imask,LVIF_TEXT
lea eax,itembuff1
mov lvi.pszText,eax
mov lvi.cchTextMax,256
invoke SendMessage,hListView,LVM_GETITEM,0,addr lvi
:
:



well at least i think it?s correct so far ;)
now i should have the Item and the first subitem
i thought i simply could maybe try somethin like this to change the bitmap



mov lvi.iImage,1
invoke SendMessage,hListView,LVM_UPDATE,lvi.iItem,0


but it doesn?t work, any idea what would be wrong ?
LVM_UPDATE needs only the index of the selected Item which shall be updated and that
should be still lvi.item ...

confused :(
Posted on 2002-12-06 07:15:31 by Allanon
Allanon,

This works fine for me:

mov lvi.imask,LVIF_IMAGE
mov lvi.iItem,0
mov lvi.iSubItem,0
mov lvi.iImage,1
mov lvi.pszText,0
invoke SendMessage,hListView,LVM_SETITEM,0,ADDR lvi

If not, send your code and I'll have a look at it.


Guy
Posted on 2002-12-06 09:25:07 by Guy
yup works fine thanx a lot :)
i didn?t know that i could use LVM_SETITEM also for updates
Posted on 2002-12-06 10:04:52 by Allanon

Allanon,

This works fine for me:

mov lvi.imask,LVIF_IMAGE
mov lvi.iItem,0
mov lvi.iSubItem,0
mov lvi.iImage,1
mov lvi.pszText,0
invoke SendMessage,hListView,LVM_SETITEM,0,ADDR lvi

If not, send your code and I'll have a look at it.


Guy

If you set LVIF_IMAGE as imask why do you need
to zero pszText?
It supposed to be ignored because of imask.
Posted on 2002-12-06 14:04:07 by The Svin