Solved

SHBrowseForFolder and shortcuts

Posted on 2003-10-28
1
304 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
1 Comment
 
LVL 48

Accepted Solution

by:
AlexFM earned 200 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now