Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
F

Fredb45

@Fredb45
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SHGetSpecialFolderLocation error !!!
    F Fredb45

    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

    C / C++ / MFC help data-structures announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups