7 Replies - 1789 Views - Last Post: 19 February 2012 - 08:03 PM Rate Topic: -----

#1 Bluezap  Icon User is offline

  • D.I.C Regular

Reputation: 1
  • View blog
  • Posts: 440
  • Joined: 19-January 12

Add key to registry

Posted 18 February 2012 - 02:09 AM

I want an option in the context menu of Windows to open my software when clicked.
To do this i need to create a key in the HKEY_CLASSES_ROOT\*\shell directory
I did some research but couldn't figure out how i can create a key to open up my application
I need the key to be created when the user clicks the "Add to windows context menu" Command button
And i need the key to be removed when the user clicks the "Remove from windows context menu" Command button

Is This A Good Question/Topic? 0
  • +

Replies To: Add key to registry

#2 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 206
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: Add key to registry

Posted 18 February 2012 - 02:19 AM

this might help.

This post has been edited by nK0de: 18 February 2012 - 02:38 PM

Was This Post Helpful? 1
  • +
  • -

#3 Bluezap  Icon User is offline

  • D.I.C Regular

Reputation: 1
  • View blog
  • Posts: 440
  • Joined: 19-January 12

Re: Add key to registry

Posted 18 February 2012 - 02:38 AM

View PostnK0de, on 18 February 2012 - 02:19 AM, said:

maybe [url="http://www.codeproject.com/Articles/10104/Add-a-context-menu-to-the-Windows-Explorer"]this[/url] might help.

I am writing my program in Visual Basic 2010.So i need a Visual basic compatible code.
The project you specified above is a C# project.

And i need this to happen without the user specifying the location and the name of my program.(It needs to be done automatically)

This post has been edited by Bluezap: 18 February 2012 - 02:43 AM

Was This Post Helpful? 0
  • +
  • -

#4 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 206
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: Add key to registry

Posted 18 February 2012 - 02:44 AM

yes, but you can convert it. The differences between VB.NET and C# syntax is not too big.
Was This Post Helpful? 0
  • +
  • -

#5 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1728
  • View blog
  • Posts: 5,707
  • Joined: 25-September 09

Re: Add key to registry

Posted 18 February 2012 - 02:32 PM

View PostBluezap, on 18 February 2012 - 04:38 AM, said:

And i need this to happen without the user specifying the location and the name of my program.(It needs to be done automatically)

So don't prompt the user for that information, set it yourself. That link shows the concept of adding to a context menu it doesn't mean you can't convert the code (Google C# to VB.Net Converter) and learn from it to get it to perform to your specifications.
Was This Post Helpful? 0
  • +
  • -

#6 Bluezap  Icon User is offline

  • D.I.C Regular

Reputation: 1
  • View blog
  • Posts: 440
  • Joined: 19-January 12

Re: Add key to registry

Posted 19 February 2012 - 09:56 AM

View PostCharlieMay, on 18 February 2012 - 02:32 PM, said:

View PostBluezap, on 18 February 2012 - 04:38 AM, said:

And i need this to happen without the user specifying the location and the name of my program.(It needs to be done automatically)

So don't prompt the user for that information, set it yourself. That link shows the concept of adding to a context menu it doesn't mean you can't convert the code (Google C# to VB.Net Converter) and learn from it to get it to perform to your specifications.

Ok i converted the code successfully and it works perfectly but the problem is that i want that option to be on the context menu at all times no matter where the user right clicks.The option doesn't appear when i right click on the desktop.It only appears when right clicking on a folder.
How do i modify the code so that it will show on all context menus on windows?

This post has been edited by Bluezap: 19 February 2012 - 09:57 AM

Was This Post Helpful? 0
  • +
  • -

#7 iJoris  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 21
  • Joined: 22-July 11

Re: Add key to registry

Posted 19 February 2012 - 01:51 PM

Take a look at THIS.
Was This Post Helpful? -1
  • +
  • -

#8 Bluezap  Icon User is offline

  • D.I.C Regular

Reputation: 1
  • View blog
  • Posts: 440
  • Joined: 19-January 12

Re: Add key to registry

Posted 19 February 2012 - 08:03 PM

View PostiJoris, on 19 February 2012 - 01:51 PM, said:

Take a look at [url="http://social.msdn.microsoft.com/Forums/da/netfxbcl/thread/0f19a2f6-99fa-4f06-84d7-5c304bc189aa"]THIS[/url].

I know how to write a key into the registry.I don't know where to write it so that it appears on all context menus on windows.
Can some one please give me a solution to that question?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1