PDA

View Full Version : AddFolderIcon equivalent for internet shortcuts?



crehbein
05-05-2004, 03:56 PM
I'd like to programmatically add an internet shortcut, but not use a .url file so I can customize the icon used.

Is there a function similar to AddFolderIcon() that makes it simple to add an internet shortcut? One idea I had was to create a shortcut that runs "start http://<website>" using AddFolderIcon, but I haven't experimented yet.

MichaelU
05-10-2004, 11:15 AM
Hello Chris,

The Knowledge Base (http://support.installshield.com/kb) has some good articles including Q105380 INFO: Creating an Internet Shortcut (http://support.installshield.com/kb/view.asp?articleid=Q105380). This describes one process.

By its appearance the file is an INI style file, so you may also be able to come up with a more dynamic solution using WriteProfString (http://helpnet.installshield.com/robo/projects/devstudio9helplangref/LangrefWriteProfString.htm).

Michael

crehbein
05-10-2004, 12:48 PM
Originally posted by MichaelU

By its appearance the file is an INI style file, so you may also be able to come up with a more dynamic solution using WriteProfString (http://helpnet.installshield.com/robo/projects/devstudio9helplangref/LangrefWriteProfString.htm).


I thought about using such a file, but I'm assuming the file needs to have a .url extension and thus would have the Internet Explorer logo for an icon, which isn't acceptable. The link I need to make is essentially a shortcut to an application (running on a local web app. server like Tomcat) and needs to have a custom icon.

I guess the "official" way to add a shortcut using the System Config->Shortcuts view is the right way to do this, but I was hoping for a way to create it in my installscript.

Thanks for the help!

MichaelU
05-10-2004, 01:17 PM
Hello Chris,

Sorry I misread your initial post. It looks like you can create a shortcut to the .url file, and that this shortcut can have an icon you specify. Of course this does require an additional file sitting somewhere such as your <TARGETDIR>.

Michael

RobertDickau
05-11-2004, 08:48 AM
As an aside, for a .url file I believe you can specify an IconFile (and IconIndex) entry to override the default icon...

crehbein
05-11-2004, 09:58 AM
Originally posted by RobertDickau
As an aside, for a .url file I believe you can specify an IconFile (and IconIndex) entry to override the default icon...

Aha, that is correct. And useful. Here's an example if anyone wants to do this:

[InternetShortcut]
URL=http://www.somesite.com
IconFile=<path to icon file>
IconIndex=<index of icon>

For future reference, it might be useful if these and any other parameters were included in the "How do I create an internet shortcut?" section of the faq.

There's a handful of other parameters that can be set. Google's cache turned up an "Unofficial Guide to the URL File Format" which used to be hosted at cyanwerks.com that lists these other fields:

[InternetShortcut]
URL=http://www.someaddress.com/
WorkingDirectory=C:\WINDOWS\
ShowCommand=7
IconIndex=1
IconFile=C:\WINDOWS\SYSTEM\url.dll
Modified=20F06BA06D07BD014D
HotKey=1601

URL
The URL field is self-explanatory. It’s the address location of the page to load. It should be a fully qualifying URL with the format protocol://server/page. A URL file is not restricted to the HTTP protocol. In general, at least, whatever that can be saved as a favorite is a valid URL.


WorkingDirectory
It’s the “working folder” that your URL file uses. The working folder is possibly the folder to be set as the current folder for the application that would open the file. However Internet Explorer does not seem to be affected by this field.

Note: this setting does not seem to appear in some versions of Internet Explorer/Windows.


IconIndex
The Icon Index within the icon library specified by IconFile. In an icon library, which can be generally be either a ICO, DLL or EXE file, the icons are indexed with numbers. The first icon index starts at 0.


IconFile
Specifies the path of the icon library file. Generally the icon library can be an ICO, DLL or EXE file. The default icon library used tends to be the URL.DLL library on the system’s Windows\System directory


Modified
An 8-byte FILETIME structure followed by a 1-byte checksum denoting the modified time of the .url file. The field is reversed, so the first 4 bytes are the Lo-DWORD and the last 4 are the Hi.


ShowCommand
(Nothing) - Normal
7 - Minimized
3 - Maximized

Note: this setting does not seem to appear in some versions of Internet Explorer/Windows.


HotKey
The HotKey field specifies what is the shortcut key used to automatically launch the Internet shortcut. The field uses a number to specify what hotkey is used.

833 – Ctrl + Shift + A
834 – Ctrl + Shift + B
835 – Ctrl + Shift + C
.
.
1345 – Shift + Alt + A
1346 – Shift + Alt + B
1347 – Shift + Alt + C
.
.
1601 – Ctrl + Alt + A
1602 – Ctrl + Alt + B
1603 – Ctrl + Alt + C


There's more info and more hotkey values listed at the website. Google +"Windows" +"url file" - it was the first result.