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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Explorer

Explorer

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialdata-structuresquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fedrer
    wrote on last edited by
    #1

    Hello, I want to create application like windows explorer. I think I can use builtin tree and builtin list view. I think there are some interface IShellFolderTree or IShellFolderList. Can you please guide me with any example/article?

    L J 3 Replies Last reply
    0
    • F Fedrer

      Hello, I want to create application like windows explorer. I think I can use builtin tree and builtin list view. I think there are some interface IShellFolderTree or IShellFolderList. Can you please guide me with any example/article?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      See Getting Information About the Contents of a Folder (Windows)[^]. You can also use Google/Bing to do your own searches.

      1 Reply Last reply
      0
      • F Fedrer

        Hello, I want to create application like windows explorer. I think I can use builtin tree and builtin list view. I think there are some interface IShellFolderTree or IShellFolderList. Can you please guide me with any example/article?

        J Offline
        J Offline
        Jochen Arndt
        wrote on last edited by
        #3

        The IShellFolder interface is mainly used to manage folders and provide data for clipboard and drag & drop. I suggest to start without using that and implement the tree and list views using standard API functions like FindFirstFileEx and FindNextFile which provide basic information like size, time stamps and attributes. For additional info like icons and file types use SHGetFileInfo. To get the owner name for a file or directory use GetNamedSecurityInfo and LookupAccountSid. Solutions to resolve reparse points (links and mounts) can be found in the web (open with CreateFile with flags FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT and call DeviceIoControl with FSCTL_GET_REPARSE_POINT). To use the IShellFolder interface you have to get the DesktopFolder and use that to bind to other folders:

        LPSHELLFOLDER pDesktopFolder;
        ::SHGetDesktopFolder(&pDesktopFolder);

        LPSHELLFOLDER psfFolder = NULL;
        LPITEMIDLIST pFolderPIDL = ::ILCreateFromPath(lpszPath);
        HRESULT hRes = pDesktopFolder->BindToObject(
        pFolderPIDL,
        NULL,
        IID_IShellFolder,
        IID_PPV_ARGS(&psfFolder)
        );

        // Example to get the PIDL of a named file or folder within a folder
        // This PIDL can then be used for other IShellFolder operations
        LPITEMIDLIST pPIDL;
        CString strName; // name within folder
        hRes = psfFolder->ParseDisplayName(
        NULL, // no hWnd necessary when showing no dialog
        NULL, // no bind context
        strName.GetBuffer(), // non-const LPWSTR
        NULL, // no need to get number of parsed characters
        &pPIDL, // PIDL relative to the parsing folder
        NULL // attributes not used
        );
        strName.ReleaseBuffer();

        // Releasing
        ::CoTaskMemFree(pPIDL);
        psfFolder->Release();
        ::ILFree(pFolderPIDL);
        pDesktopFolder->Release();

        As you can see there are lot of tasks where some are quite complex.

        1 Reply Last reply
        0
        • F Fedrer

          Hello, I want to create application like windows explorer. I think I can use builtin tree and builtin list view. I think there are some interface IShellFolderTree or IShellFolderList. Can you please guide me with any example/article?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Hi, It's alot of work and you will need alot of COM[^] and shell expertise[^]. Have a look at the explorer clone by David Erceg: Explorer++ is a small and fast file manager for Windows.[^] It comes with full source code.[^] Best Wishes, -David Delaune

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

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