URL Shortcuts in C++ MFC

I've figured out how to process IShellLink objects in MFC, but I also want to be able to handle .url files and special shortcuts like network neighbourhood and links to network shares. How do I do this?
williamjmAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
chensuConnect With a Mentor Commented:
A URL shortcut is a plain text file, which looks like the following.

[InternetShortcut]
URL=http://www.experts-exchange.com/topics/comp/lang/cplusplus/U.williamjm

To create a shell link to an object that is not a file, use IShellLink::SetIDList instead of IShellLink::SetPath. You may get the PIDL by using the SHGetSpecialFolderLocation function.
0
 
dstCommented:
First of all: MFC SUCKS!!
Secondly: Maybe you can use ShellExecute()
0
 
williamjmAuthor Commented:
Great stuff...I should have thought of dumping the file to check its format.
Thanks.  I still have to look into how network neighbourhood works; is there anywhere I can find out about the specific ids? Or do I just experiment?
0
 
chensuCommented:
As I mentioned, use the SHGetSpecialFolderLocation function with CSIDL_NETWORK to get the PIDL for Network Neighborhood.
0
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.

All Courses

From novice to tech pro — start learning today.