I have added a context menu item in Explorer. I added it via a registry modification. On right click on a file, I want to call my compression algo on it.
At the moment, this compression feature is a method in a C# class library. I have a basic Visual Studio 2010 solution containing this class library (1 class, 1 resource file), and an install Wizard project (very simple). At the moment, when I run “install” on this install wizard, I manage to have a DLL for the class library, and my resource file dropped at the location given at install.
From my registry entry, I am able to run a command. At the moment I run notepad.exe on the right clicked file.
1. Can I somehow register my DLL to call its functions ? (I’m not looking at any shell extension, and I had the impression there was something simpler)
2. Otherwise I don’t mind creating an .exe with a console application or such. If I do so, will I get the filepath from the args parameter of my Main(string[] args) ?
3. In option 2, where do i need to reference my .exe ? I don’t see Notepad++ anywhere in my environment variables and still it is callable without specifying its path.
Thank you guys !
1. With caveats; http://blogs.msdn.com/b/codefx/archive/2010/09/14/writing-windows-shell-extension-with-net-framework-4-c-vb-net-part-1.aspx
2 & 3 If you use the simpler approach of associating an executable simply:
your_file_type\shell\open\command (default) = "c:\yourapp.exe" "%1"and your app will recieve the command line.