Add menu item to windows context menu only for text selection
Asked Answered
Z

1

10

Someone know where can I add registry key for add some function to the right-click menu only when some text is selected?

Such as copy,paste,cut function

Thanks :)

Zelda answered 29/8, 2013 at 9:53 Comment(2)
In which application / control?Murky
I also want to implement a customize context menu like this,selected some string ,and tell if it is a valid path in filesystem,then open that in a windows explorer rather than copy and open windows explorer and paste ,and then go there.Hope someone could point this out.Propellant
S
1

As per the last comment by @zionpi and the specification by @Math1000 stating "Specifically looking to convert LaTex to plain text", I am assuming that the OP is looking to add an option in the context menu for all strings(or text) displayed(or presented) by all and any applications running in the system, which allows the user to, as per the original question, open that particular selected string in explorer if it is a valid path in the system or, as per the added specification, convert that particular selected string to plain text if it is a valid LaTex code (by copying the converted LaTex code to clipboard, perhaps?).

While the validation of the selected text (to check whether it is a valid directory or LaTex code) and implementation of the operation succeeding the validation can be feasibly implemented without any difficulty, the context menu option requiring to be available for "ALL" texts displayed by "ALL" applications in the system is impossible to implement. This is because there is no way to alter the context menus of individual 3rd party applications as their context menus are regulated and controlled by the application itself by the nature of their source code during development and would require APIs released by the concerned application developers themselves to facilitate this demand.

One infamous application that allows the implementation of such behaviors is Office, for which you can build add-ons to customize certain aspects of the application (whose tutorials can be found here and here (for .NET interoperability)) to implement said requirements.

While irrelevant to the original requirement, it is worth looking into the shortcut menu handlers of the shell extension development process here as it is a better and a much more elegant way of adding/implementing right-click context menus in comparison to the way mentioned in the OP's question i.e. by editing the registry.

Swords answered 7/2, 2020 at 22:5 Comment(1)
This is kind of a sad situation, because over on macOS, you can generally do this. (Disclaimer: yes, third party apps not using the standards components don't work)Palatal

© 2022 - 2025 — McMap. All rights reserved.