What would I do to know which item in a List-view control is selected. I have it with icons, but I want to know which one is selected when the user clicks a button.
Printable View
What would I do to know which item in a List-view control is selected. I have it with icons, but I want to know which one is selected when the user clicks a button.
this code will get the first item in the list view that has been selected:
hope that helps!Code:SendMessage(hWndListView, LVM_GETNEXTITEM, (WPARAM)-1, MAKELPARAM((UINT)LVNI_SELECTED, 0));
U.
Or even
iIndex=ListView_GetSelectionMark(hwndListView);
yeah.. was going to paste that too.. but that's just a macro, and it's handy to know what's going on behind the scenes :D
good one though nova.
U.