简单示例CListCtrl的事件处理
1,NM_DBLCLK(NM_CLICK类似)
void CTestDlg::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
LPNMITEMACTIVATE lpNMItem = (LPNMITEMACTIVATE) pNMHDR;
int nItem = lpNMItem->iItem;
if (nItem != -1) // Ensure item selected
{
CString strItemText = m_Cfgfilelist.GetItemText(nItem, lpNMItem->iSubItem); // Get selected item text.
}
*pResult = 0;
}
参考文章:http://www.codeproject.com/KB/list/editing_subitems_in_listcontrol.aspx