This seemed like a common question but after doing some searching, I wasn't really able to find my answers. There is an article on this here:
http://www.codeproject.com/KB/shell/shellextguide1.aspx
But it's for a very old version of Visual Studio. I'm using VS 2008, so the instructions and interfaces don't seem to match what I'm seeing.
I want to create a simple shell extension using C++ that creates a context menu for files with extension .GZ. When right clicking on these files, I should be able to click my context menu item and have a callback in code to do some sort of operation on that file.
Other context menu items would do things like spawn modless dialogs to accept user input before executing some action.
From what I've seen, ATL is used for this but I have never used ATL, so all of the object types and interfaces are very confusing to me. It wouldn't be so bad if I had a proper tutorial or documentation to read.
Can anyone help me out? Isn't there some sort of tutorial out there that isn't 10 years old?
IContextMenu
andIShellExtInit
interfaces yourself (which all Shell Extensions are required to implement, as previously stated). If you look in the list ofRelated
topics to the right of this thread, and read a few of the linked questions, you'll get an idea of what's required. (Scrub the recommended article I provided; the link to the accepted answer is now dead (the reason I abhor link only answers)). – Leannleannaregedit
. (2) Go to [HKEY_CLASSES_ROOT\.gz]. (3) Add a subkey [shell]. (4) In that key, add subkey [Wow, it works!]. (5) In that key, add subkey [Command]. (6) Set that key's default value to [cmd /k echo doh]. (7) Create a gz file, right click and try it out. Cheers & hth., – Werner