Solved

IShellLink Interface

Posted on 1999-01-05
5
206 Views
Last Modified: 2013-11-20
How do I implement a Shell Link to activate a Desktop shortcut?
0
Comment
Question by:jnick
5 Comments
 
LVL 32

Expert Comment

by:jhance
Comment Utility
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
Comment Utility
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
Comment Utility
It is not difficult to do. See SDK help about "ShellLink", there are some good samples.
0
 

Author Comment

by:jnick
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
repeateFront java challenge 31 87
viewing source code from eclipse 13 74
tripleUp challenge 7 65
wordmultiple challenge 12 89
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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 video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

772 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

11 Experts available now in Live!

Get 1:1 Help Now