Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add a program to the windows context menu

Status
Not open for further replies.

tzzdvd

Programmer
Aug 17, 2001
52
IT
Hi,
If I right click on (for example) a folder I can see a lot of commands available (Property, Delete, Rename...).
Some particular programs can use this context menu to add their functionalities fast available for the user.
For example SVN, GnuGPG, 7Zip, Winzip, Rar...

I need to create a program that acts on a selected folder recursively for all the tree and I would like to give the same behavior as the above programs.
In this way I can go to the folder, right-click on it ad run (for example) "MyProgram" that catch the clicked folder path ad acts on it.

I have no idea on how to do it.

I can create the same program with a standalone form on which you can browse all the drives to select the desired folder but this is not what I want

I know how to create and manage a context menu but only in a form.
And also, I don't know how the program can understand which folder has been clicked on.
At the end, I would like my context menu to be visible only if some particular conditions are present such as the fact that the click has been done on a folder and not on a file.

Thanks for your help
Davide
 
I think you're mistaking what the other programs are actually doing. These program are adding a registry key setting. Believe for a folder you would look under HKEY_CLASSES_ROOT\Folder\Shell. Add a key "MyProgram", then a key called "command". Inside the command key add a string value (Default) for the name, and something like "C:\~\MyProgram.exe %arg1,%arg2". There should be an article out there to help you more if you need more details.

-jhaith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top