Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
510 views
in Technique[技术] by (71.8m points)

registry - Set icon for custom right-click context menu item for all desktop shortcuts (windows explorer)

I learned how to add an item to the right-click context menu, but I would like to add an icon too. I tested adding a value Icon to the key (imagine that the key is HKCLlnkfileshellMY COMMANDcommand, I added the icon value to HKCLlnkfileshellMY COMMAND) but it doesn't work, I put the path to the icon inside it but it's 32x32, maybe is that the problem maybe no... do someone know how to add an icon to my menu item?

Thanks for any answer

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

For Windows 7 & 8 & 10

Add custom item to Context Menu:

Sublime Text 3

Path to the application: C:Program FilesSublime Text 3sublime_text.exe.

  1. Run regedit.exe (or press Windows Start Button & type: regedit)
  2. Goto:

    HKEY_CLASSES_ROOT\*shell
    

    (* is right at the top)

  3. Right_mouse_click shell in left panel for options to create a new Key:
    1. New > Key
    2. call it: Sublime Text 3 (or whatever you like to call it)
  4. Then we create another Key under the one we just created: Right_mouse_click Sublime Text 3 (in fact: your own app's name) in left panel for options to create a new Key:
    1. New > Key
    2. call it: command
  5. In the RIGHT panel change (Default) key value (double click or Right_mouse_click & Modify) to:

    C:Program FilesSublime Text 3sublime_text.exe %1
    

    In actual fact: your own app's path.
    BUT DO ADD THE FOLLOWING AT THE END OF YOUR PATH after a space: %1.


OPTIONAL: Set Icon + Position in menu:

Icon:

  1. Click on key you created: Sublime Text 3 (Not it's child we just created: command)
  2. Create a new String Value for it (Right_mouse_click on RIGHT panel background or menu: edit, then New > Key, choose String Value)
  3. Call it: Icon
  4. Set it's value as we did for command above to:

    "C:Program FilesSublime Text 3sublime_text.exe"
    

    In actual fact: your own app's path

+

Position in context menu:

  1. Create another String Value where we created Icon just as we did above
  2. Call it: Position
  3. Set it's Value to:

    Top
    

    or if you'd like:

    Bottom
    

NOTE: ICON & POSITION STRING KEYS ARE NOT CREATED IN command, BUT ITS PARENT: whatever you called your app key in shell.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...