Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Help changing internet shortcut icon


6 replies to this topic

troy

troy
  • Members
  • 4 posts

Posted 07 August 2001 - 21:05

I'm adding an internet shortcut to the desktop using AddFolderIcon(). With internet shortcuts, you get a default icon from url.dll. I've changed the szIconPath parameter to point to a *.ico file. The shortcut is created, but the icon is the "broken link" icon(windows sysmbol on a page icon). Performing a right-click and viewing the properties shows that the icon is set to be the *.ico file I set it to. It will correctly be displayed only after I select apply or ok on the property page. Even a reboot had no effect. Does the desktop need to be invalidated and redrawn or perhaps the shortcut? Can I programmatically in IS select "ok" or "apply"? Any help is appreciated.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 07 August 2001 - 22:29

I'm surprised that you were able to create a URL shortcut with AddFolderIcon. I thought that was impossible.
Anyway, make sure you do not call LongPathToQuote for the icon path.

troy

troy
  • Members
  • 4 posts

Posted 07 August 2001 - 23:53

Quote
Quote: from Stefan Krueger on 3:29 pm on Aug. 7, 2001
I'm surprised that you were able to create a URL shortcut with AddFolderIcon. I thought that was impossible.
Anyway, make sure you do not call LongPathToQuote for the icon path.

I 'm using LongPathToQuote because the file is on the users system. I've compiled some VC++ code using IShellLink to change the icon and it does the same thing.
The internet shortcut just points to an html file on the users system. Maybe that makes a difference. I haven't tried it to an actual website url.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 08 August 2001 - 12:50

Okay, that makes a difference.
Anyway, don't call LongPathToQuote for the icon path. From AddFolderIcon help:
Do not call LongPathToQuote for the expressions passed as the parameters szWorkingDir and szIconPath. InstallShield automatically encloses these paths in quotation marks.

Blake Miller Wonder

Blake Miller Wonder
  • Members
  • 121 posts

Posted 08 August 2001 - 22:46

This is what I got out of the Platform SDK:

You can create an Internet shortcut if you have the URL of the page to which you want to link:

Create an instance of the Internet shortcut object with CoCreateInstance, using a CLSID of CLSID_InternetShortcut.

Use the IUniformResourceLocator::SetURL method to set the URL in the shortcut.

Use the IPersistFile::Save method to save the shortcut file to a desired location.


troy

troy
  • Members
  • 4 posts

Posted 08 August 2001 - 23:53

Thanks for the help. It looks like it was the LongPathToQuote issue.

Blake,

That is what I was doing in the VC++ code and it still has the problem. It works with the IS call so I don't need to do it with an exe now. I was using some wrapper classes from www.codeproject.com in the shell programming section. If anyone needs to create an internet shortcut to an actual website and IS can't do it, then I'd suggest looking there.

(Edited by troy at 4:54 pm on Aug. 8, 2001)