Does anybody know how to remove the focus from a listview item once it has been clicked? I want LVM_GETNEXTITEM to return -1 if an empty area of the listview window is clicked. The way it is now the last clicked item keeps the focus. This doesn't work well with TrackPopupMenuEx.

any help or suggestions appreciated.

best regards,

czDrillard
Posted on 2003-08-10 00:07:13 by czDrillard
Use LVM_SETITEMSTATE, in wParam specify -1 to apply the change to all items and set the LVITEM structure as follows:

LOCAL lvi :LVITEM

mov lvi.stateMask,LVIS_SELECTED
mov lvi.state,NULL

invoke SendMessage,hListView,LVM_SETITEMSTATE,-1,ADDR lvi
Posted on 2003-08-10 00:37:43 by donkey
Thanx donkey:alright:

Much appreciated.

best regards,

czDrillard
Posted on 2003-08-10 01:22:41 by czDrillard