i want to be able to delete a row that i have clicked on in my listview. how do i determine which row is selected?
smurf
If you want to delete the row by clicking it:
.elseif uMsg==WM_NOTIFY
push edi
mov edi,lParam
assume edi:ptr NMHDR
mov eax,.hwndFrom
.if eax==hListView
mov eax, .code
.if eax==NM_CLICK
assume edi:ptr NMLISTVIEW
mov eax,.iItem ;here eax equals item index to be removed
invoke SendMessage,hListView,LVM_DELETEITEM,eax,0
.endif
.endif
pop edi
;if you want to delete the row later :
mov eax,.iItem ;here eax equals item index to be removed
mov MyItem,eax ;MyItem is a dd variable that will carry the index
;of the item, then later on
invoke SendMessage,hListView,LVM_DELETEITEM,MyItem,0
thanks a nada! if you figure out anything else of interest with listviews let me know.
smurf