请问怎样获取别的程序的图标``并加载到ListCtrl里去? 请问怎样获取别的程序的图标``并加载到ListCtrl里去?求代码``代码必须经过测试``` 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //szPath是程序路径,m_List是ListCtrl,m_Imagelist是CImageList。SHFILEINFO shinfo;m_Imagelist.Create(16,16,ILC_COLOR24,0,0); m_List.SetImageList(&m_Imagelist,LVSIL_SMALL);SHGetFileInfo(szPath,0,&shinfo,sizeof(shinfo),SHGFI_ICON); index = m_List.InsertItem(index,szCaption,m_Imagelist.Add(shinfo.hIcon)); m_List.SetItemText(index,1,szPath); 常见用法如上,不多说了HICON ExtractIcon( HINSTANCE hInst, // instance handle LPCTSTR lpszExeFileName, // file name UINT nIconIndex // icon index);UINT ExtractIconEx( LPCTSTR lpszFile, // file name int nIconIndex, // icon index HICON *phiconLarge, // large icon array HICON *phiconSmall, // small icon array UINT nIcons // number of icons to extract); 【脑袋要爆炸了~】带宽的检测与分配问题! f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wingdi.cpp [急切求助]头文件条件编译问题。。。 内存泄漏 怎么设计自己想要的事件? 怎么动态画圆弧 VC如何获取主板序列号 在AfxEndThread函数中写什么? 为什么用 c++ builder 写的dll 在vc++6.0中不能调用? vc如何用ADO连接接mysql数据库? 怎样在注册表里读取一个REG_DWORD类型的数据呢? 用Detours来Hook API时,如何去Hook不同DLL中的同名的API呢
m_Imagelist.Create(16,16,ILC_COLOR24,0,0);
m_List.SetImageList(&m_Imagelist,LVSIL_SMALL);
SHGetFileInfo(szPath,0,&shinfo,sizeof(shinfo),SHGFI_ICON);
index = m_List.InsertItem(index,szCaption,m_Imagelist.Add(shinfo.hIcon));
m_List.SetItemText(index,1,szPath);
HICON ExtractIcon(
HINSTANCE hInst, // instance handle
LPCTSTR lpszExeFileName, // file name
UINT nIconIndex // icon index
);UINT ExtractIconEx(
LPCTSTR lpszFile, // file name
int nIconIndex, // icon index
HICON *phiconLarge, // large icon array
HICON *phiconSmall, // small icon array
UINT nIcons // number of icons to extract
);