Solved

right click folder - how do i add my menu item

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

786 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