How to detect a CListCtrl selection change?

前端 未结 4 796
囚心锁ツ
囚心锁ツ 2020-12-10 10:33

I want to execute some code when the user selects a row in a CListCtrl (report view, I don\'t care about the other viewing modes).

How do I catch this event? is the

4条回答
  •  余生分开走
    2020-12-10 10:51

    On my Visual Studio 2010, the visual editor declares a callback in the dialog header file like this:

    afx_msg void OnLbnSelchangeListOnvif();
    

    and in the source file:

    BEGIN_MESSAGE_MAP(CDialogOnvif, CDialog)
        ON_LBN_SELCHANGE(IDC_LIST_ONVIF, &CDialogOnvif::OnLbnSelchangeListOnvif)
    END_MESSAGE_MAP()
    
    void CDialogOnvif::OnLbnSelchangeListOnvif()
    {
        // do stuff...
    }
    

提交回复
热议问题