Question

I need to write a shell extension for a small context menu. unfortunately i reused the code available in open source which uses .net 4.0

now the problem is the requirement is I shud not use .NET 4.0.

Instead is there a way where in I can make an entry in the registry so that the shell extension pops out

My requirement is .... 1. The shell extension context menu should display only on .txt, .csv, .xls files. 2. Upon click of shell extension I need to start a different process, by passing the full name of the file on which we click as parameter to the process.

Was it helpful?

Solution

If you just want to add items to the context menu for certain file types, and in response launch an external application, you don't need to write a shell extension. Registry entries are enough to express this.

As the http://www.jfitz.com/tips/rclick_custom.html article you linked to says, for each file type you want to act on, you need to add a new registry key under the Shell subkey, then create a subkey called command, whose value is the name of the application to launch.

To pass the name of the file you clicked on to this external application, add "%1" to the command. Include the quotes, so that if the file's name contains spaces, it will still be treated as one token by the receiving program.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top