Is there an equivalent event to LBN_SELCHANGE
but for a listview?
views:
259answers:
2
+2
A:
Use LVN_ODSTATECHANGED
for the event.
The event parameter is a pointer to a struct of type NMLVODSTATECHANGED
. Use the uNewState
and uOldState
bit-fields to determine which of these are selection changes (because there are other changes as well). You're looking for the LVIS_SELECTED
flag.
Jason Cohen
2009-01-23 14:47:09
A:
case WM_NOTIFY:
NMLISTVIEW *VAL_notify = (NMLISTVIEW*)VII_lParam;
if(VAL_notify->hdr.code == LVN_ITEMCHANGED && VAL_notify->hdr.idFrom == IDC_SOMECONTROL && (VAL_notify->uNewState & LVIS_SELECTED))
{
// Use VAL_notify->iItem as the new selected item
}
OJW
2009-01-23 15:09:43