Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

URL Shortcuts in C++ MFC

Posted on 1998-07-15
4
Medium Priority
?
794 Views
Last Modified: 2012-05-04
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
Comment
Question by:williamjm
[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
  • 2
4 Comments
 

Expert Comment

by:dst
ID: 1167883
First of all: MFC SUCKS!!
Secondly: Maybe you can use ShellExecute()
0
 
LVL 23

Accepted Solution

by:
chensu earned 400 total points
ID: 1167884
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
 

Author Comment

by:williamjm
ID: 1167885
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
 
LVL 23

Expert Comment

by:chensu
ID: 1167886
As I mentioned, use the SHGetSpecialFolderLocation function with CSIDL_NETWORK to get the PIDL for Network Neighborhood.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

721 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