我用列表控件,显示几个了项,现在要获得某项的图标,要怎样做呢?

解决方案 »

  1.   

    CImageList::GetImageInfo/ExtractIcon();
      

  2.   

    刚刚试了/ExtractIcon();还是不行,能给个例子吗?谢谢!
      

  3.   


    int   i, dx, cx, cy, nCount = m_myImageList.GetImageCount();
    HICON hIcon;::ImageList_GetIconSize(m_myImageList, &cx, &cy);// Draw the images of the image list on the DC.
    for (dx = 0, i = 0; i < nCount; i++)
    {
       hIcon = m_myImageList.ExtractIcon(i);   dc.DrawIcon(dx, 0, hIcon);
       dx += cx;
    }MSDN上的例子程序