如何让我的程序界面上显示的图标和WINDOWS桌面上显示的一模一样?包括快捷方式,文件夹和文件等等!
解决方案 »
- 如何开始DirectShow编程?
- install shiled12 开机自运行
- 菜鸟求助:怎么显示位图????高手请指点
- 如何在VC8中使用DEF文件导出class
- 为什么我在RickEditCtrl中不能改变前两个中文汉字的颜色?
- 关于sql数据库中日期型字段无法在CRecordView对象中显示的问题。
- 请问在VC++.net ATL COM 中怎么添加一个函数??我要用编辑器自动生成,不想手写
- 帮帮忙吧!!!!!各位大侠!!!1
- 怎么把CString对象的字符内容转到一个字符数组里??
- 在这最后的大学时光里,我衷心感谢那些给我帮助的兄弟姐妹们!!!
- Create table tablename();
- 跟大家讨论一下基本的知识?
但是链接事件怎么做,思路简单一点的就好!
void Cxxxx::EnableImages()
{// Get the handle to the system image list, for our icons
HIMAGELIST hImageList;
SHFILEINFO sfi; hImageList = (HIMAGELIST)SHGetFileInfo((LPCSTR)_T("C:\\"),
0,
&sfi,
sizeof(SHFILEINFO),
SHGFI_SYSICONINDEX | SHGFI_SMALLICON); if (hImageList)
{// Attach ImageList to TreeView
m_Tree.SendMessage(TVM_SETIMAGELIST,(WPARAM)TVSIL_NORMAL,(LPARAM)hImageList);
// Attach ImageList to ListView
m_List.SendMessage(LVM_SETIMAGELIST,(WPARAM)LVSIL_SMALL,(LPARAM)hImageList);
}
}
///
int CStep1::GetItemIcon(CString path,UINT uFlags)
{
SHFILEINFO sfi; SHGetFileInfo((LPCSTR)path,0,&sfi,sizeof(SHFILEINFO),uFlags); if(sfi.iIcon<0) sfi.iIcon=m_iO82Image;
//
return sfi.iIcon;
}
// for tree
void Cxxxx::GetNormalAndSelectedIcons(CString path,LPTV_ITEM lptvitem)
{
//Note that we don't check the return value here because if GetIcon()
//fails, then we're in big trouble... lptvitem->iImage = GetItemIcon(path, //SHGFI_PIDL |
SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
lptvitem->iSelectedImage = GetItemIcon(path,// SHGFI_PIDL |
SHGFI_SYSICONINDEX | SHGFI_SMALLICON |
SHGFI_OPENICON);
return;
}