Registry: Adding a new file type to HKCR\SystemFileAssociations


  1. Posts : 6
    Windows 10
       #1

    Registry: Adding a new file type to HKCR\SystemFileAssociations


    I want to create a new context menu that is only visible on audio files.

    Doing this on an extension-by-extension basis is not a solution because I need the added context menu to be visible when selecting multiple different audio types (i.e. different extensions, such as .wav, .mp3, .flac etc.).

    I can get this to work by creating my new context menu key in HKCR\* but this adds the context menu to every file type (so it appears on non-audio files where the context menu is not wanted).

    I did some digging around in the Registry and found the key HKEY_CLASSES_ROOT\SystemFileAssociations\audio (there's also ones for documents, images and video).

    Adding my new context menu key only to SystemFileAssociations\audio (and nowhere else) works as intended: My context menu shows up on .wav, .mp3, .wma, .aiff, .au, and a few other audio file types, and it remains visible even when selecting across multiple different audio file types in Explorer.

    However, the problem is that the audio file formats over which this works is rather limited. It does not work with .flac, .ogg / .oga, .opus and .wv (which are other audio file types that I want the new context menu to show up on).

    Does anyone know how I can add these file types to the list of extensions that are already recognized as audio files? (i.e in the same way that .mp3, .aiff and .wav files etc. are being handled)

    I've checked the PerceivedType for my audio files, but that makes no difference. I then saw some suspiciously familiar extensions lists in Windows Media Player's file association and MIME type lists (which matched the extensions that had responded to my new context menu) but adding new file types to WMPs extensions and registered MIME types didn't work either.

    I even tried (in a clean OS in a virtual machine) installing a codec pack so that pretty much every audio file type could play back in WMP, then I associated all those audio file types with WMP by default to see if that would make these extra audio file types become recognized as belong to the group 'audio', but that didn't work either.

    Interestingly, my context menu also got added to .mid files even though they are not audio files (in the sense that they don't actually contain any audio). So there is some kind of music / audio classification of extensions going on somewhere, regardless of the actual content of the file. It's by designation rather than by content.

    I have seen other posts on the net mention similar problems with other file association groups (such as 'images' and 'documents' where certain basic files (such as .bmp in the case of 'images') respond and work as intended, but other file types from the same category do not.

    What's the best way to achieve the outcome I'm looking for (either by being able to add more audio file types to the existing list of files currently being affected by the 'audio' key in SystemFileAssociations, or perhaps there is another key elsewhere (that already exists, or which could be created) that allows a context menu to be visible on the specified types even when more than one of the specified file types has been selected.
      My Computer


  2. Posts : 43,274
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    Hi, interesting question, and may not be possible as this is simply not how the process has been conceived.

    I think you'd need a tool designed to pick out the perceived type, and add the data to each corresponding key for each such file type.

    There are many context editors around, and I have a few to hand, but none which do that as far as I know.

    I'll throw this in as something which might be of passing interest, but doesn't solve the problem: Nirsoft's Filetypesman
    Registry: Adding a new file type to HKCR\SystemFileAssociations-1.jpg

    Also this may be of interest:
    windows - Create context-menu entries for a given extension - Stack Overflow

    Considering 'perceived type' - this is prominent in considering search, rather than anything else..
    https://docs.microsoft.com/en-us/win...-perceivedtype
    Last edited by dalchina; 19 Jun 2019 at 23:12.
      My Computers


  3. Posts : 920
    Windows 10 Pro
       #3

    I will also throw my hat in the ring and suggest giving Nirsoft's Filetypesmanager a look, I have only used it for icons so far, but using its descriptive text for each file type has allowed me to manually alter icons for e-mail (.eml) and pdf files amongst others.
    The point being these are very hard to change without some digging into how the registry enumerates file types and associated actions.
    Filetypesmanager gives you the insight when you use it to see how filetypes are registered and associated.
      My Computer


  4. Posts : 43,274
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #4

    For reference only- some deeper documents:
    https://docs.microsoft.com/en-us/win...menu-handlers#
    https://docs.microsoft.com/en-us/win...erceivedtypes#
    It does not work with .flac, .ogg / .oga, .opus and .wv (which are other audio file types that I want the new context menu to show up on).
    Is the perceived type for these specified as audio in your registry? (See Filetypesman listing).
    Perhaps you checked- not 100% sure:
    I've checked the PerceivedType for my audio files, but that makes no difference.
    FWIW I can confirm that a context menu entry I added at
    HKEY_CLASSES_ROOT\SystemFileAssociations\audio\shell
    appears for e.g. mp3's but not ogg, as you say. Both have perceived type set as audio.
    Last edited by dalchina; 20 Jun 2019 at 03:50.
      My Computers


  5. Posts : 43,274
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #5

    One difference I note between the file types of perceived type audio where the context menu added here
    HKEY_CLASSES_ROOT\SystemFileAssociations\audio\shell

    applies and those to which it doesn't, is that the first have a 'persistent handler', and the latter don't.

    E.g. mp3 does:
    Registry: Adding a new file type to HKCR\SystemFileAssociations-mp3-reg-hkcr.jpg

    flac doesn't
    Registry: Adding a new file type to HKCR\SystemFileAssociations-flac-reg-hkcr.jpg

    But a persistent handler is related to Windows search:
    http://howtoyo.blogspot.com/2012/04/...t-handler.html
    https://docs.microsoft.com/en-us/win...tering-filters

    Could it possibly be that's why some extensions are picked up and others not? Seems an unnecessary correlation. Yet Indexing Options/Advanced shows no difference between ogg,flac and mp3. So perhaps there's something else to discover.
    Last edited by dalchina; 20 Jun 2019 at 04:37.
      My Computers


  6. Posts : 920
    Windows 10 Pro
       #6

    My 2 pence worth...it was by altering the icon listed under the actual persistent handler that I changed the .pdf and .eml icons. Search for that persistant handler in the registry and maybe add the context menu item there may do what the OP wanted?
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:10.
Find Us




Windows 10 Forums