C# how to add shortcut of my program using right click

How to add shortcut of a program when right click of files!

Page 1 of 1

3 Replies - 2260 Views - Last Post: 28 September 2009 - 07:18 PM Rate Topic: -----

#1 dunk_6  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 03-August 09

C# how to add shortcut of my program using right click

Posted 27 September 2009 - 11:45 PM

Hi all,

Using codes, I wanna add a shortcut of my c# program when i right click of a specific files like doc, pdf, jpeg, etc.

From this site:http://www.codeproje...appendmenu.aspx

I noticed that this codes, is for folder right click. what if i want to click at only the particular type of files?
private const string MenuName = "Folder\\shell\\NewMenuOption";
private const string Command = "Folder\\shell\\NewMenuOption\\command";


I try change "Folder" into ".doc" extension, but nothing happend.

Thank you!

Is This A Good Question/Topic? 0
  • +

Replies To: C# how to add shortcut of my program using right click

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: C# how to add shortcut of my program using right click

Posted 28 September 2009 - 05:25 AM

try this link...

http://blog.voidnish.com/?p=17
Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6021
  • View blog
  • Posts: 23,395
  • Joined: 23-August 08

Re: C# how to add shortcut of my program using right click

Posted 28 September 2009 - 08:13 AM

Well, eclipsed4utoo, that didn't help in the last thread on this subject...let's see if it does this time :)
Was This Post Helpful? 0
  • +
  • -

#4 dunk_6  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 03-August 09

Re: C# how to add shortcut of my program using right click

Posted 28 September 2009 - 07:18 PM

View Posteclipsed4utoo, on 28 Sep, 2009 - 04:25 AM, said:



It works... thank you so much!!
  • Can explain it to me, which keyword does it tell that which registry it will write into? it seems that this code write the registry in HKEY_LOCAL_MACHINE\software\classes\word.document.8 for .doc extension...?? Why not we write it into HKEY_CLASSES_ROOT, like example from codeproject.com?
  • How about if i want it to be able to use for more than one extension file here?
    AddContextMenuItem(".zip", "ZipStrip",
      "Open with &ZipStrip", Application.ExecutablePath + " %1");
    

    eg: doc, pdf, txt will be open by my program. Can i still use this function?




thanks again!!

This post has been edited by dunk_6: 28 September 2009 - 09:08 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1