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: Stefan2, white, sheep, Hacker

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

TC shows only standard icon for URL files

Post by *DrShark » 2017-10-12, 19:09 UTC

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.
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37344
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2017-10-13, 10:04 UTC

This behaviour is fully intentional and will not be changed, sorry.
Author of Total Commander
http://www.ghisler.com

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

Post by *DrShark » 2017-10-14, 08:21 UTC

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?
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right

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

Post by *DrShark » 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"
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"?
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right

User avatar
Dalai
Power Member
Power Member
Posts: 6562
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai » 2017-10-14, 14:39 UTC

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
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37344
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 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.
Author of Total Commander
http://www.ghisler.com

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

Post by *DrShark » 2017-10-16, 13:34 UTC

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?
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right

give_up
New Member
New Member
Posts: 1
Joined: 2018-01-22, 11:57 UTC

Post by *give_up » 2018-01-22, 12:05 UTC

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: 1265
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262

Re: TC shows only standard icon for URL files

Post by *DrShark » 2019-04-24, 12:13 UTC

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?
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37344
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC shows only standard icon for URL files

Post by *ghisler(Author) » 2019-04-25, 09:36 UTC

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

[HKEY_CLASSES_ROOT\.url]
@="InternetShortcut"
Author of Total Commander
http://www.ghisler.com

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

Re: TC shows only standard icon for URL files

Post by *DrShark » 2019-04-25, 12:42 UTC

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.
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37344
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC shows only standard icon for URL files

Post by *ghisler(Author) » 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.

You need to delete the DefaultIcon entry if you want to use the icon handler instead.
Author of Total Commander
http://www.ghisler.com

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

Re: TC shows only standard icon for URL files

Post by *DrShark » 2019-04-29, 17:23 UTC

ghisler(Author) wrote:
2019-04-29, 13:58 UTC
You 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
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right

Post Reply