Solved

right click folder - how do i add my menu item

Posted on 2004-05-03
5
339 Views
Last Modified: 2010-04-24
good day im prob unlucky but ive been looking for ways in .net to add my menu item  when i right click a folder.
0
Comment
Question by:jxharding
  • 2
  • 2
5 Comments
 
LVL 21

Expert Comment

by:tovvenki
ID: 10976535
Hi,

I think you can do that by using ContextMenu class. Have alook at this url
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconContextMenus.asp

I hope that this answers your problem.

Venki
0
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 500 total points
ID: 10976641
Do you mean when you right click on a folder or file in the explorer, you will see your program listed in the context menu so you can run it.

if so, you need to add a key in the registry (you can do this in your program or manual)

KEY:     HKEY_LOCAL_MACHINE, "software\classes\*\shell\"YOUR PROGRAM NAME"\command"
VALUE: "c:\program files\{YOUR PROGRAM DIRECTORY}\{YOUR PROGRAM} %1"
0
 

Author Comment

by:jxharding
ID: 10977040
i apologize for not describing the situation properly
0
 

Author Comment

by:jxharding
ID: 10983980
how can  i run this registry edit from vb.net?
do i really have to have a .reg file which the user has to execute?, get asked if the user is sure and then press yes?

how can i remove this registry edit from the computer when it is uninstalled?

should i make this a new question?
0
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 10984280
You don't need a reg file, just use the registry class in .net. If you search in the help file under registry, you will find loads off samples explaining how to add and remove registry entries.

Private Sub CreateAndSetKey
    Dim regVersion As Microsoft.Win32.RegistryKey
    regVersion = _
Microsoft.Win32.Registry.LocalMachine.CreateSubKey("SOFTWARE\classes\*\YOURPROGRAMNAME")
  regversion.setvalue("command","YOURPROGRAM %1")
End Sub

as for removing the registry key on uninstall, I think this is done automatically when you add the registry in your deployment project, if not remove via the custom action (uninstall) in your deployment project
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question