title: How to add Images to CListCtrl in MFC
body: <p>How do you add Images to a <code>ClistCtrl</code> in MFC? I have tried and found that it's quite difficult.</p>
  <p>I used <code>CImageList</code> to add images and then passed it to the <code>CListCtrl</code>. Can you provide some samples?</p>
  <pre><code>m_sentToCListCtrl.InsertColumn(0, _T(&quot;Item Name&quot;), LVCFMT_LEFT,nColInterval*3);     
  m_sentToCListCtrl.InsertColumn(1, _T(&quot;Value&quot;),LVCFMT_LEFT, nColInterval);
  m_sentToCListCtrl.InsertColumn(2, _T(&quot;Time&quot;), LVCFMT_LEFT, rect.Width()-4*nColInterval);
  ListView_SetExtendedListViewStyle(m_sentToCListCtrl.m_hWnd,LVS_EX_CHECKBOXES );
  
  // Create 256 color image lists     
  HIMAGELIST hSentToList =ImageList_Create(84,71, ILC_COLOR8 |ILC_MASK , 8, 1);
  m_sentToImageList.Attach(hSentToList);
  </code></pre>