May 11th, 2010, 04:33 PM
Smart shortcut icon?
I've created a shortcut to a folder using this example (http://www.codeguru.com/cpp/w-p/file...icle.php/c7209), passing in CLSID_FolderShortcut to CoCreateInstance(). It works fine, but unfortunately the icon is just a plain folder icon, without the little arrow to indicate that it's a shortcut.
I know that I could use IShellLink::SetIconLocation(), but that seems awfully inefficient - why doesn't the icon get set as a shortcut icon automatically? Is there an easier way to do it than create my own copy of a generic folder-shortcut icon and SetIconLocation() to it?
Thanks in advance for your help.
May 12th, 2010, 09:08 AM
Shortcut to Folder
I also just noticed that in Explorer, the type is displayed as Folder instead of Shortcut. I've attached screenshots of the desired and actual outcomes. (The "desired" was created manually, by right-clicking on the folder and selecting "Create Shortcut", and the "actual" was created by my app.)
If I can get the Type set to Shortcut, the icon will likely correct automatically. Passing CLSID_ShellLink instead of CLSID_FolderShortcut doesn't work at all.
So, how do I set the Type to Shortcut instead of Folder?
May 12th, 2010, 03:08 PM
Re: Smart shortcut icon?
Forgive me, I don't intend to keep bumping this, but I got one new bit of information. My tester has informed me that the icon is correct on Windows 7. It's only Windows XP that displays the plain folder icon instead of the folder shortcut icon. If anyone could provide some insight as to why, it would be much appreciated!
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!