Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

right click folder - how do i add my menu item

Posted on 2004-05-03
5
Medium Priority
?
350 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

721 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