这是代码:SHFILEINFO shfi;
memset(&shfi,0,sizeof(shfi));
DWORD_PTR result=SHGetFileInfo(L"D:\\www\\",
FILE_ATTRIBUTE_NORMAL,
&shfi,
sizeof(shfi),
SHGFI_ICON|SHGFI_USEFILEATTRIBUTES);
DestroyIcon(m_iconShow.SetIcon(shfi.hIcon));
怎么得到的是未知类型的图标啊?
我的系统是vista,用的是vc2008

解决方案 »

  1.   

    If SHGFI_SMALLICON is included with SHGFI_SYSICONINDEX, the return value is the handle to an image list that contains the small icon images. 
    DestroyIcon(m_iconShow.SetIcon(shfi.hIcon));????这个是什么意思?The DestroyIcon function destroys an icon and frees any memory the icon occupied
    ......
      

  2.   

    You must initialize Component Object Model (COM) with CoInitialize or OleInitialize prior to calling SHGetFileInfo.
    另外,确保m_iconShow.SetIcon(shfi.hIcon)是将icon的句柄复制了一份,而不是仅仅使用了句柄