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

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?
0
williamjm
Asked:
williamjm
  • 2
1 Solution
 
dstCommented:
First of all: MFC SUCKS!!
Secondly: Maybe you can use ShellExecute()
0
 
chensuCommented:
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
 
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

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