tags:

views:

198

answers:

2

Hi!

I have two questions. My first one is, that how can i "put" something into the default windows right click pop-up menu? I mean, if i click with the right mouse button on an .exe, then the default things appers(like cut, copy, send to, run as...), but how can i put there one extra line, like "MyApp", which will start my application? I want to do all this in c++. My second question is, how can i get the filename (or the full path) on which i have started MyApp from the pop-up menu?

Thank in advance!

kampi

A: 

1) Sounds like you're looking to simply alter or add to the context menu that is provided by Windows Explorer. It's really just a matter of registry settings. See here for a good example.

2) If you follow the zip example of the link above you'll see that the path to the target file is passed to the zip application. Your application, if it accepts arguments can similarly get the path to the file that is being open.

Paul Sasik
Basicly want i want is this. I go to c:\Program Files\Internet Explorer\ and on the iexplore.exe i right click, and start MyApp. But i need to get the above path, because MyApp will use it. So do you know how could i get it?
kampi
See my modification of #2. Might make more sense.
Paul Sasik
+1  A: 

Check this stackoverflow post: http://stackoverflow.com/questions/76553/adding-item-to-the-desktop-context-menu-in-windows

Such a handler must be registered in HKCR\Directory\Background, instead of usual locations like HKCR\Directory, HKCR\Folder, etc.

Check out Creating Shell Extension Handlers in MSDN.

There's a series of articles on CodeProject that details writing Shell Extensions and is very good:

http://www.codeproject.com/KB/shell/shellextguide1.aspx

Ryan Christensen