Solved

right click folder - how do i add my menu item

Posted on 2004-05-03
5
323 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

762 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now