hi all,

Actually i already posted question about this earlier, but there is some issue that still irritates me abit.

Using LVM_SETITEMSTATE with state set to 0 and statemask LVIS_FOCUSED removes the rectangle, but not right away. The rectangles stays visible for some little time. (doing it when there is a focus change among the items). Same thing with setting the focus to another control.
Is there any other way to remove it completely so it wont be visible at all?
Posted on 2005-01-23 18:03:17 by arafel
HI,

What if you use

MOV lvi.statemask, ( LVIS_SELECTED or LVIS_FOCUSED )

Antonis
Posted on 2005-01-24 00:19:47 by akyprian
thanks, i'll try it
Posted on 2005-01-24 10:36:14 by arafel
ok. got rid of the little pause, but still can't make it work completely :(
.elseif [edi.NMHDR].code == LVN_ITEMCHANGED


mov eax, [edi.NMLISTVIEW.iItem]
mov lvi.iItem, eax
mov lvi.iSubItem, 0
mov lvi.imask, LVIF_STATE
mov lvi.state, LVIS_SELECTED
mov lvi.stateMask, LVIS_FOCUSED or LVIS_SELECTED
invoke SendMessage, hList, LVM_SETITEM, 0, ADDR lvi

Removes the focus and sets selection correctly. But only when there is no LVS_SINGLESEL style. However if multiple selection enabled, previously selected item does not deselected. I guess i should remove the selection in LVN_ITEMCHANGING than?

the following fails (the app just crashes)
.elseif [edi.NMHDR].code == LVN_ITEMCHANGING


cmp [edi.NMLISTVIEW.uOldState], LVIS_SELECTED
jne @f

mov eax, [edi.NMLISTVIEW.iItem]
mov lvi.iItem, eax
mov lvi.iSubItem, 0
mov lvi.imask, LVIF_STATE
mov lvi.state, 0
mov lvi.stateMask, LVIS_SELECTED
invoke SendMessage, hList, LVM_SETITEM, 0, ADDR lvi
@@:
Posted on 2005-01-24 11:24:51 by arafel
Hello arafel,

Just happened to see your post, maybe you got everything working now by I use this to remove focus:
                        mov lvi.stateMask,LVIS_FOCUSED

mov lvi.state,NULL
invoke SendMessage,hList,LVM_SETITEMSTATE,\
-1,ADDR lvi


I never experienced any delay in removing focusing rectangle.

Hope this is helpful and best regards,

czDrillard
Posted on 2005-01-29 23:18:13 by czDrillard
from within what message are you doing LVM_SETITEMSTATE?

by the way i need to keep the selection rectangle and remove the focus rectangle.
Posted on 2005-01-30 15:14:38 by arafel
found a better solution other than manually setting items state. hope someone with the same problem will find this useful.
invoke SendMessage, hList, LVM_SETCALLBACKMASK, LVIS_FOCUSED, 0 
Posted on 2005-02-05 16:29:43 by arafel