Wrong processing of shell's Unknown file type

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
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Wrong processing of shell's Unknown file type

Post by *MVV »

There is an association for all unregistered file types in a registry:

Code: Select all

HKEY_CLASSES_ROOT\Unknown\shell
If I add open action or edit openas one, I can change default action on Enter for unregistered file types in Explorer. However such association doesn't work in TC - it shows 'Open with' dialog anyway.

Test:
1. Open regedit and go to mentioned key.
2. Export it to reg file (backup copy).
3. Add/edit subkeys open\command and openas\command and change default parameter value to e.g. notepad.exe "%1".
4. Do dblclick or Enter on any unregistered file type in Explorer to be sure it works in it - it should open file in a notepad.
5. Do dblclick or Enter on same file in TC. Notice different behaviour.
6. Delete above mentioned key and execute saved [at the step 2] reg file to restore its previous state.

Tested with TC8rc1[x32/x64] and TC7.04a @ Win7x64Ult.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48096
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

"Unknown" isn't currently supported by TC, and I will not add it just when the final release is near, sorry. Currently TC calls rundll32.exe with parameter
OpenAs_RunDLL filename

when there is a file with no association. It seems that OpenAs_RunDLL doesn't use the above key. There doesn't seem to be a standard method to use this key, so everything would have to be done manually. This could get really difficult with things like DDE or shell extensions.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Does OpenAs_RunDLL works better than simple ShellExecute?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48096
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I haven't tested ShellExecute or ShellExecuteEx with files not having any association.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Just tested it now, ShellExecute works just like Enter in Explorer (executes action from Unknown key or shows Open with dialog).

Code: Select all

ShellExecute(0, 0, L"D:\\TEMP\\1.txt", 0, 0, SW_SHOWDEFAULT);
ShellExecute(0, 0, L"D:\\TEMP\\1.bla", 0, 0, SW_SHOWDEFAULT);
So ShellExecuteEx should work in same way.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48096
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I will consider it for TC 8.1. I have different code for NT-based Windows and 9x-based Windows in TC, so it's not wise to change that now.
Author of Total Commander
https://www.ghisler.com
Post Reply