These 2 classes encapsulate the IShellLink
& IUniformResourceLocator COM interfaces as provided in Win32. These 2 interfaces
allow you to programmatically create the ubiquitous shortcuts (*.lnk files) as
well as Url shortcuts (*.url files).
The class provides an simple MFC wrapper over the SDK API.
The classes also provides auto cleanup and is UNICODE enabled with build configurations
zip file contains the CShellLink & CUrlShellLink source
code and also includes a VC 2005 solution to build a small demonstration app.
- You are allowed to include the source code in
any product (commercial, shareware, freeware or otherwise) when your product
is released in binary form.
- You are allowed to modify the source code in
any way you want except you cannot modify the copyright details at the top
of each module.
- If you want to distribute source code with
your application, then you are only allowed to distribute versions released
by the author. This is to maintain a single distribution point for the
v1.0 (10 December 1998)
V1.1 (12th December 1998)
- Updated sample program to be called
- Fixed a bug in CUrlShellLink::Save where
m_sTarget was not being set.
- Updated the trace comments in the code to
include the function from which the function fails.
- Demo program now displays some info about
what it is doing to the console window.
- Default build configuration is now
ASCII Debug instead of Unicode Debug.
V1.11 (4 April 2001)
- Updated copyright information
- Fixed 2 bugs in CURLLink::Save and CURLLink::Load.
Thanks to Martin MacRobert for spotting the problems
- Fixed COM interface leaks in
V1.12 (26 January 2003)
- Fixed up #include of system headers so that they can be
included in the PCH
- Moved initialization of the GUIDs from the code to the
- Fixed a copy and paste bug in the CShellLink::GetArguments()
method. Thanks to "Bin" for reporting this problem.
V1.13 (20 December 2006)
- Updated copyright details.
- Addition of a SHELLLINK_EXT_CLASS preprocessor macro to allow the class
to be more easily added to an extension DLL.
- Optimized CShellLinkInfo constructor
- Optimized CShellLink constructor
- Code now uses newer C++ style casts instead of C style casts.
- Optimized CUrlShellLink constructor
- Updated the sample app to clean compile on VC 2005
- CShellLinkInfo is no longer derived from CObject as it was not really
- Classes now use ATL's CComPtr for managing the various COM pointers
- Return values from functions now use HRESULT's instead of plain BOOL's
- The way the classes are now initialized have been reworked based on the
way the "FinalConstruct" mechanism works in ATL
- CUrlShellLink class is now no longer derived from CShellLink class
- Fixed a potential COM reference count bug in CShellLinkInfo::operator=
where we were making naked copies of a PIDL. Now the code makes a copy of
the PIDL so that each CShellLinkInfo class instance maintains its own
separate copy of its PIDL.
- Updated the documentation to use the same style as the web site.
V1.14 (21 May 2011)
- Updated copyright details.
- Updated code to compile cleanly using VC 2005 and later
- The code has now been updated to support VC 2005 or later only.
- Moved all the code inline into shelllink.h and did a major refactoring
of the code to provide a cleaner wrapping for the IShellLink and
- Added comprehensive support for IShellLinkDataList and all its supported
structures including EXP_DARWIN_LINK, EXP_SPECIAL_FOLDER, EXP_SZ_LINK,
NT_CONSOLE_PROPS, NT_FE_CONSOLE_PROPS and EXP_PROPERTYSTORAGE
V1.15 (21 May 2011)
- Major refactor of the code into new helper classes of
CPropertyStoreForShellLink, CShellLinkDataList & CShellLinkHelper. The two
main classes of CShellLink and CUrlShellLink now provide various Get methods
to pull out these helper classes
- Updated the classes to support the following Windows 7 properties: PKEY_AppUserModel_ExcludeFromShowInNewInstall, PKEY_AppUserModel_PreventPinning