Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I used the code in the below link
http://www.codeproject.com/KB/cs/appendmenu.aspx?fid=171288&select=3329164&tid=3329164

But I need to link the menu with my application, i.e, my application should be opened while clicking that menu.
Posted

You need to set the registry key value to be the command that opens your application.

You obviously need to know the installation path of your app, and then the command you would set on the registry key would be something like "c:\program files\myApp\mystuff.exe".

(Just don't hard code the "c:\program files" bit, make sure you pick it up from your actual apps installation location.)
 
Share this answer
 
See how I did this in
Folder protection for windows using C# & Concepts on Windows Shell menu for Folders[^]

I have just used HKCR\Folder\shell\ and added one menu(you can see the image).

I have just passed %1 with the executable in the Command.

Now from my application I can get the file path in the Argument List.

download the Source and inspect how I did.

Cheers.
:rose:
 
Share this answer
 
No it is not possible. :((

Actually context menu is applied to a CLASS ID, not based on actual folder.

So if you apply this, it will affect all folders even the folders you will be creating in future.
 
Share this answer
 
Thank You. I got the solution.

Is it possible to apply the menu item only for particular folder?

The above code append the menu item for all folders. But I need to enable that menu item only for a particular folder. Is it possible?
 
Share this answer
 
Ok. Thank You for your reply. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900