列表框显示图标问题

static CImageList ProcessImg; 定义在头文件

str->InsertItem(0, pe32.szExeFile, imageIndex);  imageIndex对应图标索引 0 1 2 3这样排列

hImageList = (HIMAGELIST)::SHGetFileInfo(tsFileDosPath, 0, &shfileinfo, sizeof(shfileinfo), SHGFI_ICON);
        if (hImageList == 0)
        {
                ProcessImg.Add(AfxGetApp()->LoadIcon(IDR_MAINFRAME));
        }
        else
        { 
                ProcessImg.Add(shfileinfo.hIcon);
        }
            str->SetImageList(&ProcessImg, LVSIL_SMALL);

 

posted @ 2015-09-21 14:44  四月是你的谎言  阅读(182)  评论(0编辑  收藏  举报