I want to retrieve icon like "my documents" in explorer but ... My init function: CShellUtil::CShellUtil() { SHFILEINFO shFinfo; HIMAGELIST hImgList = NULL; LPITEMIDLIST itemlist = 0; bError=FALSE; if (SHGetSpecialFolderLocation(0, SIDL_DESKTOP , &itemlist) == NOERROR) { hImgList = (HIMAGELIST)SHGetFileInfo((LPCTSTR) itemlist, 0, &shFinfo, sizeof(shFinfo ), SHGFI_SYSICONINDEX | SHGFI_PIDL | SHGFI_SMALLICON ); if(!hImgList) { bError=TRUE; return; } m_SysImgList.m_hImageList=hImgList; } else { bError=TRUE; return; } Function to display icon into Tree HTREEITEM CShellUtil::AddSpecialItem(HTREEITEM hParent, int nFolder) { SHFILEINFO shFinfo; int iIcon; BOOL bIsCDROM=FALSE; HTREEITEM hItem; LPITEMIDLIST pIDL; LPMALLOC pMem; if(SHGetSpecialFolderLocation(NULL, nFolder, &pIDL) == NOERROR) { if(SHGetFileInfo((LPCTSTR)pIDL, 0, &shFinfo, sizeof(shFinfo), SHGFI_DISPLAYNAME | SHGFI_PIDL | SHGFI_ICON | SHGFI_SMALLICON)) { if(SHGetMalloc(&pMem)==NOERROR) { pMem->Free(pIDL); pMem->Release(); } } } Icon = shFinfo.iIcon; hItem=m_TreeCtrl.InsertItem(_T("Test"), iIcon, iIcon, hParent); return hItem; } When i call 'AddSpecialItem', it's OK to insert special folder from "CSIDL_DESKTOP" to "CSIDL_STARTMENU" and from "CSIDL_DESKTOPDIRECTORY" to "CSIDL_LOCAL_APPDATA"-> DislplayName and Icon are OK But there is a problem from "CSIDL_MYDOCUMENTS" to "CSIDL_MYVIDEO" No icon and no display name and SHGetSpecialFolderLocation(..) return an error I try with if(SHGetFolderLocation(NULL, nFolder, NULL, 0, &pIDL) == S_OK) but no success (return E_INVALIDARG) I use lib from microsoft SDK august 2001 on win2000 Sp2 plateform with visual sp5 Please help
F
Fredb45
@Fredb45