Click here to Skip to main content
15,390,470 members
Articles / Desktop Programming / MFC
Posted 23 Jan 2001


34 bookmarked

Creating Internet Explorer style desktop shortcut.

Rate me:
Please Sign up or sign in to vote.
2.75/5 (6 votes)
5 Sep 2001
Describes in detail how to create a desktop item with customized menu and icon.


Whenever we want to create shortcuts for our programs on the desktop, what we do normally is, we create .lnk files for our programs using IShellLink. When we create it in such a way, what we get is an icon on the desktop with an arrow on its bottom left corner, and if you right click it, you'll get the normal menu, with the cut, copy, paste, delete etc. items. But if you see the Internet Explorer's shortcut icon on the desktop, it's a normal icon without the arrow on its corner and with a different menu also. (If you see Microsoft's Connection Manager, you'll see the difference more than Internet Explorer). Now lets see how to create such a shortcut on the desktop with your own customized menu items.

When you execute this code, you'll get an icon on the desktop with 'Netlinker'; as its shortcut name. If you double click it, it'll open the Internet Explorer and if you right click, you can see a customized menu with no cut, copy, paste, rename items. You also cannot delete this shortcut from the desktop. If you select the properties for this icon, it'll open the Internet Properties dialog box.


Choose a 32x32 icon and specify its path:

CString shtct_ico=_T("C:\\32x32.ico");

This is to show the Internet Explorer properties dialog box.

CString shtct_prop=_T("rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,0");

This is the shortcut name to be displayed on the desktop

CString shtct_name=_T("Netlinker");

Catch the path of the Internet Explorer and store it:

CRegKey m_Kiepath;
CString ie_path;
DWORD dwval;
String shtct_to=ie_path;

Create a GUID using guidgen.exe and copy it to the clipboard and paste it here. This is the GUID that we are going to use for the representation of our shortcut and its menu items. Here, the GUID that we have generated is 6270AEE4-AA41-11d4-A25D-008048B63F94.

Create this GUID key under the HKCR\CLSID and set the shortcut name as its value:

CRegKey m_kdsktp;

Under this GUID, create the DefaultIcon key, which represents the icon for the shortcut, so set its value with the path of the icon:


Now set the menu items for the right click menu. Here is the Open menu item, and its executable is set:


Set the properties menu item and its executable:


Now set the attributes of the menu so that the default menu items such as cut, copy, paste, rename, delete etc are removed.

BYTE *b;
HANDLE heap;
char a[20];

Now we have to create a reference for this GUID under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\Namespace. Then only it'll appear on the desktop.


Since we've played with the shell, we must notify it. Then only the changes will reflect immediately.



This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Parasuraman SundarRajan
Web Developer
India India
Sundar is having 6 years of experience in VC++. and .NET for 2+ year. Has developed the Internet Dialer for Asia's No.1 leading ISP. Involved in developing Video Surveillance components for worlds leading Security Surveillance Software Company. Worked and working on various domains such as Internet Networking, Video Codecs, CCTV Surveillance Software, Video Portals, Windows Mobile, PDAs etc. Also working on various projects which involves RAS, TCP/IP, FTP, COM, XML, .NET, Remoting, Embedded programming.

Comments and Discussions

GeneralDRAG n DROP Pin
jay_dubal23-Aug-07 3:30
Memberjay_dubal23-Aug-07 3:30 
Questioni can get the source Pin
kcselvaraj27-Nov-06 19:28
Memberkcselvaraj27-Nov-06 19:28 
GeneralThanks. Helpful Information Pin
Gautam Jain13-Jul-05 20:50
MemberGautam Jain13-Jul-05 20:50 
GeneralAdd Shell menu in List view! Pin
Selvam R24-Dec-03 12:46
professionalSelvam R24-Dec-03 12:46 

Nice Article! I have one quetion, How add the system Shell menu (like right click in the desktop, apper in the menu) in my list view control.

With REgards,

Questionhow to have popu for a shellfolder object Pin
13-Feb-01 11:19
suss13-Feb-01 11:19 
AnswerRe: how to have popu for a shellfolder object Pin
edgar20-Aug-01 7:59
Memberedgar20-Aug-01 7:59 
QuestionDrag and drop not working ? Pin
30-Jan-01 3:19
suss30-Jan-01 3:19 
AnswerRe: Drag and drop not working ?!!!!! Pin
30-Jan-01 4:21
suss30-Jan-01 4:21 
GeneralRe: Drag and drop not working ?!!!!! Pin
31-Jan-01 5:31
suss31-Jan-01 5:31 
GeneralRe: Drag and drop not working ?!!!!! Pin
edgar20-Aug-01 6:49
Memberedgar20-Aug-01 6:49 
QuestionRe: Drag and drop not working ?!!!!! Pin
jay_dubal23-Aug-07 3:26
Memberjay_dubal23-Aug-07 3:26 
QuestionWhat's the point of a private heap in this context? Pin
24-Jan-01 18:58
suss24-Jan-01 18:58 
GeneralOr you could do it in a .reg file Pin
Simon Capewell23-Jan-01 23:21
MemberSimon Capewell23-Jan-01 23:21 
Questionwhy was used this? Pin
23-Jan-01 22:36
suss23-Jan-01 22:36 
AnswerRe: why was used this? Pin
Parasuraman SundarRajan24-Jan-01 0:19
MemberParasuraman SundarRajan24-Jan-01 0:19 
GeneralRe: why was used this? Pin
24-Jan-01 1:09
suss24-Jan-01 1:09 
GeneralRe: why was used this? Pin
Simon Capewell24-Jan-01 1:31
MemberSimon Capewell24-Jan-01 1:31 
GeneralNice article, but... Pin
Thomas Freudenberg23-Jan-01 21:10
MemberThomas Freudenberg23-Jan-01 21:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.