Smart shortcut icon?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Smart shortcut icon?

  1. #1
    Join Date
    Apr 2005
    Location
    Eden Prairie, MN
    Posts
    18

    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.

    Kay

  2. #2
    Join Date
    Apr 2005
    Location
    Eden Prairie, MN
    Posts
    18

    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?
    Attached Images Attached Images   

  3. #3
    Join Date
    Apr 2005
    Location
    Eden Prairie, MN
    Posts
    18

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center