Solved

IShellLink Interface

Posted on 1999-01-05
5
225 Views
Last Modified: 2013-11-20
How do I implement a Shell Link to activate a Desktop shortcut?
0
Comment
Question by:jnick
[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
5 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 1327238
What do you mean by "activate a Desktop shortcut"?  Do you mean to create a desktop shortcut or do you want to "invoke" the object pointed to by the shortcut?
0
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1327239
If you want to create a shortcut, there is code at http://www.codeguru.com/shell/filelinks.shtml. Use the SHGetSpecialFolderPath function with the CSIDL_COMMON_DESKTOPDIRECTORY or CSIDL_DESKTOPDIRECTORY flags to get the desktop directory. And you can use the ShellExecute or ShellExecuteEx functions to execute a shortcut.
0
 

Expert Comment

by:dagangwang
ID: 1327240
It is not difficult to do. See SDK help about "ShellLink", there are some good samples.
0
 

Author Comment

by:jnick
ID: 1327241
Re: chensu's answer. I am trying your solution. However, I am having a bit of difficulty using SHGetSpecialFolderPath. According to the documentation I can use this function on Windows95 as long as I have IE 4.x installed which I do. I have included shlobj.h and set my include directories to look in mssdk\include. I still get "error C2065: 'SHGetSpecialFolderPath' : undeclared identifier" error. I've even tried defining _WIN32_IE == 0x0400. Any ideas on how to use this function?
0
 
LVL 23

Expert Comment

by:chensu
ID: 1327242
This is because the SDK you are using is not the latest. You need the latest Platform SDK. You may get it on MSDN CDs or download it at http://msdn.microsoft.com/developer/sdk/platform.htm. Another way is to use the SHGetSpecialFolderLocation and SHGetPathFromIDList functions which do not rely on IE4.
0

Featured Post

Technology Partners: 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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

695 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