Ticket #1495: DirTreeCtrl.cpp.diff

File DirTreeCtrl.cpp.diff, 1.6 KB (added by cole945, 14 years ago)
  • DirTreeCtrl.cpp

    old new  
    7272            GetRootItem(),
    7373            (LPCTSTR)list,
    7474            SHGFI_PIDL | FF_DISPLAYNAME,
    75             CSIDL_DESKTOP | FF_SYSTEM | FF_NODRAG);
     75            CSIDL_DESKTOPDIRECTORY | FF_SYSTEM | FF_NODRAG);
    7676    CoTaskMemFree(list);
    7777
    7878    /* Add `My Document' , `My Computer', etc, to `My Desktop' */
     
    8484
    8585    /* Add other normal folders to `My Desktop' */
    8686    TCHAR szPath[MAX_PATH];
    87     SHGetSpecialFolderPath(NULL, szPath, CSIDL_DESKTOP, false);
     87    /* Use CSIDL_DESKTOPDIRECTORY instead of CSIDL_DESKTOP
     88     * that phsically store file objects.
     89     * CSIDL_DESKTOP is bad if someone changes Desktop folder by Tweak UI */
     90    SHGetSpecialFolderPath(NULL, szPath, CSIDL_DESKTOPDIRECTORY, false);
    8891    DisplayPath( GetRootItem(), szPath );
    8992
    9093    Expand(GetRootItem(), TVE_EXPAND);
     
    197200    for (int i = 0; i < sfLength; i++)
    198201    {
    199202        SHGetSpecialFolderLocation(m_pOwner->m_hWnd, systemFolders[i] ,&list);
    200         SHGetSpecialFolderPath(NULL, szPath, systemFolders[i] | 0x00010000, false);
     203        SHGetSpecialFolderPath(NULL, szPath, systemFolders[i] | FF_SYSTEM, false);
    201204        hParent = AddItem(
    202205            GetRootItem(),
    203206            (LPCTSTR)list,
     
    492495                else
    493496                    return strReturn;
    494497            case CSIDL_PERSONAL:    /* My Documents */
    495             case CSIDL_DESKTOP:     /* My Desktop */
    496                 SHGetSpecialFolderPath(NULL, szPath, item.lParam & 0xFFFF, false);
     498            case CSIDL_DESKTOPDIRECTORY:        /* My Desktop */
     499                SHGetSpecialFolderPath(NULL, szPath, item.lParam & FF_LBYTES, false);
    497500                strTemp = szPath;
    498501                strTemp += _T("\\");
    499502                strReturn = strTemp + strReturn;