Ooops. Second trial:
I'm back again, fellows. I've been cut off since last friday (I had no DSL connection).
Finally tested your little tool, Alain. (The version you made last week to work with 2k/XP, I don't have the new one yet.) Works fine! Some observations:
1) There is no need to place vdsrun30.dll in the windows directory. Simply put it into the same directory as WebShortcut.exe (i.e. place both files into the K-Meleon "tools" directory).
2) In your macros, you can replace "getpref(STRING, $dir)" by "$path" ($path is defined the line below $dir).
When K-Meleon is (properly) set up as your default browser (i.e. is associated with the http protocol), the Windows OS will automatically display such a link with the K-Meleon icon. A mailto-link will automatically be displayed with the icon of your default mail client. In general, Windows will automatically display ANY shortcut (whether *.url or *.lnk) with the correct icon.
No, for URL, I always have IE icon, with w98se, w2k and XP Pro.
Sorry Alain, you are right. The official SetDefault.exe (yours, too?) does indeed NOT perform a correct icon setup! The following is written to the registry:
[HKEY_CLASSES_ROOT\K-Meleon.HTML\DefaultIcon]
@="C:\\Program Files\\K-Meleon\\K-Meleon.exe,1"
[HKEY_CLASSES_ROOT\http\DefaultIcon]
@=""
[HKEY_CLASSES_ROOT\https\DefaultIcon]
@=""
You see, what's wrong! The default icon location for protocols http and https is set to an empty string instead to "...\K-Meleon.exe,1" (I forgot, that I had corrected this). Therefore, Internet Shortcuts to http(s) addresses are shown with the default icon of *.url files. And that is an IE icon. I consider this to be a cosmetic bug. Perhaps you can update your version of SetDefault.exe in regard to this.
Following some further notes, that might be helpfull to you, Alain:
---------------------------------------
Windows Registry & Default Applications
---------------------------------------
Structure of the Windows Registry
---------------------------------
There are three keys in the Windows Registry, that store class data (data related to file types and protocols):
- HKEY_CLASSES_ROOT
- HKEY_CURRENT_USER\Software\Classes
- HKEY_LOCAL_MACHINE\Software\Classes
The settings in HKEY_LOCAL_MACHINE (HKLM) affect all users. Any user can read from HKLM. But (on WinNT) only privileged users can write to HKLM.
The settings in HKEY_CURRENT_USER (HKCU) only affect the currently logged on user. Any user can read from and write to HKCU, because any user has his own HKCU key.
HKEY_CLASSES_ROOT (HKCR) is a virtual key. HKCR is a copy of HKLM\Software\Classes overwritten with HKCU\Software\Classes. Thus, HKCR stores all the data that is valid for the current user.
In consequence, an application should
allways read class data from HKEY_CLASSES_ROOT. Writing class data to the Windows Registry however, is much more complicated. Since HKCR is a virtual key, a write request to HKCR will be redirected to either HKCU\Software\Classes or HKLM\Software\Classes. Which of both it actually is will depend on the circumstances and is nearly unpredictable (at least to me
. So, I myself
avoid writing to HKEY_CLASSES_ROOT. Explicitely write to HKCU\Software\Classes (this will allways work, but will only affect the current user) or to HKLM\Software\Classes (this will affect all users, but will only work, when the current user is privileged).
Default Browser (and Default Applications in general)
-----------------------------------------------------
The meaning of the term "Default Browser" is very fuzzy. Sometimes, the default browser is referred to as default application for HTML files (I would call this the "Default HTML Viewer", however). And sometimes, it is referred to as default application for the http: (and https
protocol. But of course, these two (three) settings can be configured individually. You can associate *.htm(l) files with MSIE, http: protocol with Opera and https: protocol with K-Meleon (doesn't really make sense though, but just to give an example). Now make your choice what you call the default browser! IMO, there is no default browser. There are only default applications for specific file types or protocols.
These default applications (and the corresponding default icons) can be determined like this:
[HKEY_CLASSES_ROOT\.<FileExtension>]
@="<DocumentType>"
[HKEY_CLASSES_ROOT\<DocumentType>\DefaultIcon]
@="<DefaultIconLocation>"
[HKEY_CLASSES_ROOT\<DocumentType>\shell]
@="<DefaultAction>"
; IF "<DefaultAction>" == "" THEN
[HKEY_CLASSES_ROOT\<DocumentType>\shell\open\command]
; ELSE
[HKEY_CLASSES_ROOT\<DocumentType>\shell\<DefaultAction>\command]
; ENDIF
@="<DefaultCommandLine>"
[HKEY_CLASSES_ROOT\<Protocol>\DefaultIcon]
@="<DefaultIconLocation>"
[HKEY_CLASSES_ROOT\<Protocol>\shell\open\command]
@="<DefaultCommandLine>"
Default Mail Client
-------------------
The default mail client (icon) can be determined like this:
[HKEY_CLASSES_ROOT[b]mailto[/b]\DefaultIcon]
@="<DefaultIconLocation>"
[HKEY_CLASSES_ROOT[b]mailto[/b]\shell\open\command]
@="<DefaultCommandLine>"
The information stored in HKLM\Software\Clients\Mail is somehow irrelevant. That is, because these settings are only used by Internet Explorer and by "Internet Options" control panel. The values below
HKCR\mailto\shell\open\command\
and
HKLM\Software\Clients\Mail\<DefaultMailer>\
only correspond, when you use "Internet Options" control panel to set your default mail client!
4) a way to create lnk shortcut to allow, for example, to open a link with IE.
See:
Open URL shortcut in IE with K-M as default browser?