?
Solved

SHBrowseForFolder and shortcuts

Posted on 2003-10-28
1
Medium Priority
?
330 Views
Last Modified: 2013-12-03
Hi!
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?
Thanks!
Christie
0
Comment
Question by:muellerfan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 48

Accepted Solution

by:
AlexFM earned 800 total points
ID: 9639636
I think you need to use some Browse for Folder dialog which allows to show also files, for example, this:

http://www.codeguru.com/dialog/DirSelDlg.html

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:

http://www.codeproject.com/shell/cshelllink.asp

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.


0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question