The main idea of programming the Windows shell is that you can associate this type of file (extension) with the fact that MS is currently calling progid (for example, Company.Type.Ver):
HKCR \ .txt @ = Acme.Text.1
HKCR \ Acme.Text.1 @ = This is a progid for text file associations for Acme
And then Acme Corp can put as many shell verbs as they want, like subkeys of HKCR \ Acme.Text.1 \ shell, such as HKCR \ Acme.Text.1 \ shell \ open.
But if I am XyzCorp, how to add a secondary verb to text files?
I don’t want to usurp the main file association - I am glad that it is associated with Acme.Text.1, but I want to add “Import to Xyz Editor”.
I could:
1. add a verb to Acme progid (for example, HKCR \ Acme.Text.1 \ shell \ my-verb)
2. Create a new progid from both of our sides and copy the Acme data into it and merge the XyzCorp verbs in that
3. add verbs directly to the file extension (at least one of them has been used)
4.???
Does anyone know the “correct” answer to this question?
EDIT: I'm really not thrilled with any solution that involves the need to modify someone else's PROGID. I would prefer to add something - IContextMenu or something else, outside of the associated PROGID, to add additional verbs / parameters to a specific file type.
It seems that such a crazy system has ext-> progid, where the progid belongs to separate development houses and can be removed or changed this way if desired. It amazes me as fragile (delete something and poof, your file extension stops working properly or installs something, and your secondary verb disappears, because ext now maps to another proprietary PROGID to which I did not add our verb, when we were (at the wrong time, knowing something about this other, yet non-existent prog)), and just dumb. After all this time, have all these versions of Windows and Microsoft never figured out a way to have handler layers for a given file type? Indeed?!?
I just find it crazy! Junior programming 101 includes learning a command pattern or other multi-level / cascading systems. Windows WinProcs themselves are organized into a command template template - so from the internal window context to the external set of possible handlers they get a crack in this MSG.
Of course, there is a way to add a verb that applies to several extensions without overriding the primary association of extensions extensions, which itself is completely independent of the primary mapping to the extension → progid (so that the user can install several programs over time, and still have access to the secondary verb for this type of file).
I suppose I can look at HKCR. * ... I understand its ability to add verbs there that apply to all types of files. But then I need to find a filtering method so that our verb is really present only for those actual file types that we should apply ...