Article ID: 200054
Article Last Modified on 11/21/2006
void CGensdiView::OnInitialUpdate()
{
CView::OnInitialUpdate();
m_pCtrl = new CMyListCtrl;
m_pCtrl->Create(WS_VISIBLE | WS_CHILD | WS_BORDER
| LVS_REPORT | LVS_EDITLABELS,
CRect(0, 0, 100, 150), this, 2134);
m_pCtrl->InsertColumn(0, "one");
m_pCtrl->InsertItem(0, "0 0 0 0 0 0 0 0 0 0 0");
m_pCtrl->InsertItem(1, "1 1 1 1 1 1 1 1 1 1 1");
m_pCtrl->InsertItem(2, "2 2 2 2 2 2 2 2 2 2 2");
}
void CGensdiView::OnLButtonDown(UINT nFlags, CPoint point)
{
m_pCtrl->m_timerID = m_pCtrl->SetTimer(14, 500, NULL);
TRACE("timer %d is set\n", m_pCtrl->m_timerID);
}
CMyListCtrl::CMyListCtrl()
{
m_timerID = -1;
}
void CMyListCtrl::OnTimer(UINT nIDEvent)
{
if (nIDEvent != m_timerID)
CListCtrl::OnTimer(nIDEvent);
TRACE("OnTimer %d\n", nIDEvent);
}
Additional query words: CListview CListctrl WM_TIMER OnTimer KillTimer SetTimer once
Keywords: kblistview kbprb kbtimer KB200054