Solved

right click folder - how do i add my menu item

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

920 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

13 Experts available now in Live!

Get 1:1 Help Now