TC shows only standard icon for URL files

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

TC shows only standard icon for URL files

Post by *DrShark »

This is a known issue. For example, for me TC shows index 5 icon from C:\Windows\System32\url.dll for all *.url files while Windows Explorer shows per-file icons if they are referenced in url to some local file or the URL file has the icon stored in file's own NTFS alternative data stream called :favicon.

The explanation from TC author I got in emails:
Christian Ghisler wrote:Total Commander does NOT use iconhandler [defined for association in Registry] when there is a DefaultIcon entry, unless it is set to %1 or "%1". This is intentional to speed up loading of icons.

[So] TC currently only gets per file icons if the DefaultIcon is set to %1 [in Registry or in TC via Files - Associate - Edit type - Change icon]. However, even if I set this to %1 for URL files, Windows
always returns the default icon to Total Commander
.
Possible solutions to get per-file icons in TC are welcome, because per file icons would make it much easier to work with many url files.

The current workaround I use is the opensource NTFS FileStreams (v2) FS-plugin by ProgMan13.
It shows url files as folders, and shows the url icons for such folders (as well as inner ::$DATA files) if url file has custom icon.
To launch the url file from plugin, I'm starting the ::$DATA file (located inside url folder) using either Enter key or mouse doubleclick.

This workaround, however, has some limitations because of its FS-plugin nature: currently it's not possible to start that ::$DATA file from TC's command line or button bar using a command like this one:
"\\\NTFS - streams\$%Favorites%\SomeInternetShortcut.url\::$DATA"

TC also currently doesn't show the per file icon (showed in by plugin in TC filelist) for the button if such path is used in button's Icon path.
Last edited by DrShark on 2017-10-14, 09:31 UTC, edited 1 time in total.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This behaviour is fully intentional and will not be changed, sorry.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

ghisler(Author) wrote:This behaviour is fully intentional and will not be changed, sorry.
You mean you know how to show per file icons for *.url but you don't want implement that into TC? Why?
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

OK, I see now, for *.url the icon is actually definded Windows Registry as

Code: Select all

[HKEY_CLASSES_ROOT\InternetShortcut\DefaultIcon]
@="C:\\Windows\\System32\\url.dll,5"
and there's also the icon handler record present in HKEY_CLASSES_ROOT\InternetShortcut\, but TC doesn't use it because DefaultIcon is not %1 or "%1".

How about adding a feature, for future TC versions, to let user define custom list of extensions where TC will use icon returned by icon handler even if DefaultIcon is not %1 or "%1"?
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

I find it very distracting if files of the same file type use/show different icons. That's definitely something I don't want to have in TC. If this gets implemented, please make it optional.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, I mean that TC ignores the icon handler if the DefaultIcon isn't set to %1 or "%1". Maybe I will make it an option, but there isn't enough time now before the release of TC 9.10 final.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

ghisler(Author) wrote:Maybe I will make it an option, but there isn't enough time now before the release of TC 9.10 final.
Thanks, I think it won't hurt anyone if you'll make it as wincmd.ini parameter with user defined extensions (with masks like *.* to tell TC to prefer icon handler for all extensions).

Maybe it's better to move this topic to Suggestions forum since behavior may me changed in future TC versions?
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
give_up
New Member
New Member
Posts: 1
Joined: 2018-01-22, 11:57 UTC

Post by *give_up »

I agree with DrShark that there should be wincmd.ini parameter which allows to enable custom icon for URL files. It will really help me to work with files in TC.
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: TC shows only standard icon for URL files

Post by *DrShark »

DrShark wrote: 2017-10-14, 09:27 UTC OK, I see now, for *.url the icon is actually definded Windows Registry as

Code: Select all

[HKEY_CLASSES_ROOT\InternetShortcut\DefaultIcon]
@="C:\\Windows\\System32\\url.dll,5"
ghisler(Author) wrote: 2017-10-15, 07:17 UTC Yes, I mean that TC ignores the icon handler if the DefaultIcon isn't set to %1 or "%1". Maybe I will make it an option, but there isn't enough time now before the release of TC 9.10 final.
Is there a chance to see such icon handlers support in next major release of TC?
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC shows only standard icon for URL files

Post by *ghisler(Author) »

Hmm, this should work - das .url point to InternetShortcut, e.g.

[HKEY_CLASSES_ROOT\.url]
@="InternetShortcut"
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: TC shows only standard icon for URL files

Post by *DrShark »

ghisler(Author) wrote: 2019-04-25, 09:36 UTC Hmm, this should work - das .url point to InternetShortcut, e.g.

[HKEY_CLASSES_ROOT\.url]
@="InternetShortcut"
Indeed, TC shows an icon @="C:\\Windows\\System32\\url.dll,5" for all url files.
However, it seems Explorer uses also additional icon handler to show per-file url icons (if one stored in favicon as url file NTFS stream):

Code: Select all

[HKEY_CLASSES_ROOT\InternetShortcut\ShellEx\IconHandler]
@="{FBF23B40-E3F0-101B-8488-00AA003E56F8}"
I sent screenshots (TC and Explorer) and exported reg keys, as well as a sample .url file with favicon stream, in today email.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC shows only standard icon for URL files

Post by *ghisler(Author) »

Yes, TC prefers the DefaultIcon over the IconHandler, because in the past some icon handlers were causing crashes. This way you can use the icon handler in Explorer and the DefaultIcon in TC.

You need to delete the DefaultIcon entry if you want to use the icon handler instead.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: TC shows only standard icon for URL files

Post by *DrShark »

ghisler(Author) wrote: 2019-04-29, 13:58 UTCYou need to delete the DefaultIcon entry if you want to use the icon handler instead.
Thanks, now per file icons appear for url files with favicon streams.

It's interesting that now for my .url files without favicon stream (or custom icon defined by IconFile parameter in url file) that point to http or https addreses, icon handler returns an icon from opera.exe, while for other protocols (I had .url files with about:, gcf:, res:), as well as for invalid url files with .url extension it returns "C:\Windows\System32\url.dll,5" even after I removed "C:\\Windows\\System32\\url.dll,5" value from @ parameter of DefaultIcon key. It seems Explorer's URL icon handler uses also icons defined for protocols in some other Registry locations. Does anybody know a tool to change icons for certain protocols?
ghisler(Author) wrote: 2019-04-29, 13:58 UTC Yes, TC prefers the DefaultIcon over the IconHandler, because in the past some icon handlers were causing crashes. This way you can use the icon handler in Explorer and the DefaultIcon in TC.
Please consider adding a wincmd.ini parameter to prefer IconHandler if it and DefaultIcon both are present. Something like UseIconHandler=*.url
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: TC shows only standard icon for URL files

Post by *DrShark »

DrShark wrote: 2019-04-29, 17:23 UTC
ghisler(Author) wrote: 2019-04-29, 13:58 UTC Yes, TC prefers the DefaultIcon over the IconHandler, because in the past some icon handlers were causing crashes. This way you can use the icon handler in Explorer and the DefaultIcon in TC.
Please consider adding a wincmd.ini parameter to prefer IconHandler if it and DefaultIcon both are present. Something like UseIconHandler=*.url
Could this option be added into TC 10.5x? Please.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Claudio Salvio
New Member
New Member
Posts: 1
Joined: 2022-05-29, 20:38 UTC

Re: TC shows only standard icon for URL files

Post by *Claudio Salvio »

DrShark wrote: 2022-06-06, 20:42 UTC
DrShark wrote: 2019-04-29, 17:23 UTC
ghisler(Author) wrote: 2019-04-29, 13:58 UTC Yes, TC prefers the DefaultIcon over the IconHandler, because in the past some icon handlers were causing crashes. This way you can use the icon handler in Explorer and the DefaultIcon in TC.
Please consider adding a wincmd.ini parameter to prefer IconHandler if it and DefaultIcon both are present. Something like UseIconHandler=*.url
Could this option be added into TC 10.5x? Please.
Please @ghisler(Author) add a config option to handle this.

Best regards,
Claudio Salvio
Post Reply