Wrong file icon, Windows 10

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

VSB
Member
Member
Posts: 136
Joined: 2006-12-12, 12:02 UTC
Location: Russia

Wrong file icon, Windows 10

Post by *VSB »

At Windows 10 files have wrong (blank) icons in TC before them association is "confirmed".

This is very annoying, especial for those ones, which should not (e.g. build artifacts) or rarely are opened by double-click, so user confirmation may happen not very soon.

https://1drv.ms/u/s!AqDlJAwxGUl1g1qbb9bgnuPc_b_E

Arrrhh!! posting image in this forum is very complicated sometimes!
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

No blank icons here on actual Windows 10 and TC 9.20b2
For what file types you are missing icons ?
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
VSB
Member
Member
Posts: 136
Joined: 2006-12-12, 12:02 UTC
Location: Russia

Post by *VSB »

2Horst.Epp
Look at screenshot. I have new installation of Win10 and Visual Studio 2017 on it.

vcxproj, filters have no icons. Even cpp and h had no icons before I double-clicked them and "confirm" VS association.

Also (semi-offtop) file -> open with (not internal, but System associations in TC) shows only those types, which have "open" verb.
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 can happen when there is no defined association for the extension, but instead the key "percievedtypes" is used. Total Commander currently ignores this key because there is no association defined yet. All it does it prompt the user to pick a program.
Author of Total Commander
https://www.ghisler.com
VSB
Member
Member
Posts: 136
Joined: 2006-12-12, 12:02 UTC
Location: Russia

Post by *VSB »

2ghisler(Author)
I understand this. Can you load icons in this case too?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately it's not so easy because I don't currently have any programs installed with this problem, so I cannot replicate it here. I'm using Visual Studio 2005 (for backwards compatibility with Windows XP), and it doesn't have this problem.
Author of Total Commander
https://www.ghisler.com
VSB
Member
Member
Posts: 136
Joined: 2006-12-12, 12:02 UTC
Location: Russia

Post by *VSB »

The simple way to replicate is to install VS 2017 Community on clean Win 10, then just do nothing (do not try open files, confirm associations, etc.) - Explorer will have icons, TC no.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Is there any small program with this problem? VS 2017 is huge, and I also fear that it will break my VS2005 installation.
Author of Total Commander
https://www.ghisler.com
VSB
Member
Member
Posts: 136
Joined: 2006-12-12, 12:02 UTC
Location: Russia

Post by *VSB »

I'll try to create small installer of simple program (like notepad) with fake association to reproduce this problem
VSB
Member
Member
Posts: 136
Joined: 2006-12-12, 12:02 UTC
Location: Russia

Post by *VSB »

Well, the simplest way to reproduce, is import such reg file

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.txttest]
"PerceivedType"="text"
"Content Type"="text/plain"

[HKEY_CLASSES_ROOT\.txttest\OpenWithProgids]
"txtfile"=""
and create dummy.txttest file. This accurately imitates my case with VS2017@Win10
Explorer will show icon, TC does not

I don't know, how you load icons. What about SHGetFileInfo (slow) or IExtractIcon (more fast and flexible)?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks, that was very helpful!
Author of Total Commander
https://www.ghisler.com
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 should be fixed in beta 3, please test it!
Author of Total Commander
https://www.ghisler.com
VSB
Member
Member
Posts: 136
Joined: 2006-12-12, 12:02 UTC
Location: Russia

Post by *VSB »

Good, but not enough.

Sorry for incorrect test case. Just discovered this on another file type (packages.config for example)

Try to remove PerceivedType - Explorer will show icon, TC does not
I suppose that icon is chosen by first (completely not sure) entry of OpenWithProgids

Offtop: file association became so unclear since XP(
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I have created a new type .txttest2 with just the OpenWithProgIDs key. Indeed Windows then uses the icon from that entry. However, it's not clear which icon it uses when there are multiple entries under OpenWithProgIDs, e.g.
txtfile
soffice.StarWriterDocument.6

Here Explorer uses the LibreOffice icon, although when I double click, I get a chooser dialog. And when I then choose Notepad, and don't set it as the default via checkbox, Windows still picks notepad on the next double click - but the icon remains as the one from LibreOffice. There is also no change to the registry.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, this should work better in Total Commander 9.20 beta 4, please check! However, it's still not clear what should happen when there is more than one entry in OpenWithProgIDs. Currently I use these rules:

1. Computer\HKEY_CLASSES_ROOT\.txttest\OpenWithProgIDs has only one entry -> use that

2. Computer\HKEY_CLASSES_ROOT\.txttest\OpenWithProgIDs has more than one entry
-> use alphabetically first from OpenWithProgIDs

3. It seems that Explorer uses entries from here:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txttest\OpenWithList

If it is not empty, Explorer gets first character from MRUList, e.g. -> 'a'. Then it gets value of 'a', e.g. soffice.bin.
But then I'm stuck - there is no key named soffice.bin (libreoffice), but Explorer still finds the right icon.

Btw, if the key from 3. is there buit the one from 1+2 is missing, Explorer does NOT use it.
Author of Total Commander
https://www.ghisler.com
Post Reply