I want to associate a file extension .mps.gz to an application on Windows 10.
The .gz extension should not be affected. How can I do this?
I want to associate a file extension .mps.gz to an application on Windows 10.
The .gz extension should not be affected. How can I do this?
Copyright © 2021 Jogjafile Inc.
You cannot in general because Windows only cares about the text after the last period.
There are of course ways to hack around it. The naive way would be for your application to handle it. If the original registration looks like
you would change it to
And if myapp.exe is executed with something you don't handle you would call
ShellExecuteExon the file and setlpVerbtoopen.A better solution would be to decide inside the shell before anything is executed. For Windows 95 to 10 you could implement
IContextMenuand only add your default menu item inQueryContextMenuif you like the file in the data object. TheMayChangeDefaultMenusubkey must exist for this to work. On Windows 7, 8 and 10 you could implementIExplorerCommandStateinstead if you prefer a static verb.For Windows 11 I suppose you are going to handle
IExplorerCommand::GetStatebut I don't know if this lets you become the default handler.