Getting list control events for a CListView

Imagine you have a CView derived view, like a CListView. You would like to do some treatments when events occurs on the list control ,like a double click. Since you don’t know the control ID of the CListCtrl in the CListView, you can’t just do a :

ON_NOTIFY(NM_DBLCLK, IDC_VIEWLISTCTRL, OnDblclkList)

This is the utilitiy of ON_NOTIFY_REFLECT

ON_NOTIFY(NM_DBLCLK, OnDblclkList)

Try it, it’s magic, it works !

Leave a Reply

Your email address will not be published. Required fields are marked *