How to add new items to right-click event on Folders and Files in Windows?

后端 未结 4 2046
一个人的身影
一个人的身影 2020-12-03 04:14

I did google couple of tutorials on google.

I am able to add right-click menu item to a FOLDER by doing this:

[HKEY_CLASSES_ROOT\\Di         


        
4条回答
  •  遥遥无期
    2020-12-03 04:39

    The key word you're looking for is 'verbs' or 'handlers' not 'events'.

    Context menu verbs for particular file extensions can be placed under the ProgID for the file type, the Perceived Type key (if the file type has a perceived type), the AllFileSystemObjects key, or the Base Class Key (*).

    Note that writing to these keys in the HKEY_CLASSES_ROOT hive will redirect the writes to HKEY_LOCAL_MACHINE\Software\Classes, and will require elevated privileges. If you write to the HKEY_CURRENT_USER\Software\Classes tree, you can do this with standard user rights.

    It's up to you to handle a scenario where multiple files are selected. One instance of your application will be launched per file you have selected. You can solve this by checking if another instance of your application is running, and using Inter-Process Communication to notify the existing instance that other extensions have been selected.

    On MSDN, be sure to read

    • Overview of Verbs and File Associations
    • Creating Context Menu Handlers

提交回复
热议问题