• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 354
  • Last Modified:

SHBrowseForFolder and shortcuts

I am using SHBrowseForFolder inside of an MFC application in order to browse for folders.  However, it is not displaying shortcuts to folders.  I am assuming this is because shortcuts to folders are .lnk files and it is only displaying folders.  Does anyone have any idea how to display shortcuts to folders without displaying all files?
1 Solution
I think you need to use some Browse for Folder dialog which allows to show also files, for example, this:


Instead of showing of all files in directory, scan only .lnk files and resolve shortcut. If it points to directory, add directory name to the list. To resolve shortcut you can use this sample:


According to this article, you need to use CShellLink::Load and CShellLinkInfo::m_sTarget to get shortcut tatget. Use GetFileAttributes to check whether target is directory.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now