registry - Add menu item to windows context menu only for specific filetype -


I have developed an application that loads an image using window context menu (right click on file) The moment is working, but the reg key is

  HKEY_CLASSES_ROOT \ *  

and it works with all the files.

I want the menu item on the context menu to be displayed with only .jpg files.

How can I do this?

1) Identify file type (.poped) for .jpg files

This can be done by checking the default value of HKEY_CLASSES_ROOT \ .jpg . It can be anything based on the things you have established, but for the purposes of this example, we will call it a jpegfile , a normal default call.

2) Set the context menu item (verb) attribute for that file type

You HKEY_CURRENT_USER \ Software \ Classes \ jpegfile \ shell You can set per-user context menu items in . This key has a list of actions for the file type. There is a similar key in HKEY_LOCAL_MACHINE \ Software \ Classes \ jpegfile \ shell \ / code>, and the system default for these file types. You can also place an action key there, but if the same key exists in the HKCU, then it will be overridden, hence the advice will be given.

3) Set the command value

The minimum minimum value to be set to work on is that command The default value of the subkey is that you have to decide that with the path of your application such as: HKEY_CURRENT_USER \ Software \ Classes \ jpegfile \ shell \ open_with_myapp \ command to "c: \ path \ To \ Myapp.exe ""% 1 ". Now there will be an "open_with_myapp" item in the context menu for .jpg files, which will launch your app when clicked, and pass the file name of the selected file as the parameter. Of course, your application process parameters are up to you, so you have to set the parameter string to process your app.

4) Set another action property

I thought that you probably want to read context menu items to be more friendly than the key name Are there. You can have a context menu display for whatever you want for your item by setting the default value of that key ( open_with_my_map ).

This is your basic overview. Obviously, look at my answer to this question about adding a file, which has the same answer:

  • < / Ul>

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -