www.fgks.org   »   [go: up one dir, main page]

*
Quick Links|Home|Worldwide
MSDN*
Search Microsoft.com for:
Sign in to Windows Live ID
Home Search My Threads Member List Top Answerers Faq  
Visual Basic General
windows explorer's context menu for files

Thread Starter: micd7   Started: 09 Feb 2008 1:35 PM UTC   Replies: 4
Thread Information
Most Recent Reply: 14 Feb 2008, 7:17 AM UTC
Total Views: 163
Helpful Posts: 0
Status: Unanswered
  09 Feb 2008, 1:35 PM UTC
micd7
These stars recognize your participation in the forums. For more information about the different levels of stars, and how points are earned, please see the FAQ.


Posts 92
windows explorer's context menu for files
Question Was this post helpful ?
Reply Quote

 

How can I add and remove items from the windows explorer context menu for file types?

 

One example is below:

Test

Configure

Install

Scan ssmyst.scr

----------------------------

Send To>

----------------------------

Cut

Copy

----------------------------

Create Shortcut

Delete

Rename

----------------------------

Properties

 

Keep In mind two things,

 

1) Above is a context menu on windows for the screensaver install file : ssmyst.scr

 

2) I want to add something to a certain file type similar to "Scan <file>"

 

Have any tips?


   Report Abuse  
  10 Feb 2008, 1:17 AM UTC
BinaryCoder
These stars recognize your participation in the forums. For more information about the different levels of stars, and how points are earned, please see the FAQ.


Posts 464
Re: windows explorer's context menu for files
Comment Was this post helpful ?
Reply Quote

These associations are stored in the registry, which you can read and write using the Microsoft.Win32.Registry and related .NET classes.

 

First, the system checks HKEY_CURRENT_USER\Software\Classes.

Then, the system checks HKEY_LOCAL_MACHINE\SOFTWARE\Classes.

 

Open regedit to examine these structures.

 

There will be a subfolder for each registered extension, such as ".txt".

 

This key will have a (Default) value such as "txtfile".

 

Use this value, do another subkey lookup below the Classes keys mentioned above.

 

For example, we find "txtfile".  Below it there may be an shell subkey that contains an open subkey.  These are the verbs that appear on the Explorer menu.

 

If you want to store new associations, you can write them to the registry.  I would highly recommend reading the MSDN shell documentation.  See http://msdn2.microsoft.com/en-us/library/bb776870.aspx


   Report Abuse  
  10 Feb 2008, 4:11 AM UTC
micd7
These stars recognize your participation in the forums. For more information about the different levels of stars, and how points are earned, please see the FAQ.


Posts 92
Re: windows explorer's context menu for files
Comment Was this post helpful ?
Reply Quote

Have a snippet? One that can add a new item to the .tni extension context-menu that, when clicked opens the file with a certain program.


   Report Abuse  
  14 Feb 2008, 4:58 AM UTC
Riquel Dong – MSFT
These stars recognize your participation in the forums. For more information about the different levels of stars, and how points are earned, please see the FAQ.
Moderator


Posts 1,532
Re: windows explorer's context menu for files
Comment Was this post helpful ?
Reply Quote
Hi,

Based on your post, you need to create a context-menu for the specific type. First you need to register the file type.

Commonly we use setup Project to provide this facility. Add a setup project (You can find setup project in project templates from Other Projects>Setup & Deployment) for your project installation on client machines. Now in setup project there is option to Add file types and associate icons that setup will register on client machine when your software is installed. You can access File types editor by selecting the Setup project, when you select the project file in solution explorer there will be toolbar at top from there you will fine file type editor  (and few other editors) when you click  on it file type editor will open. Now you can add file types as many you need and you can associate icons and actions with them.

About creating the context menu for the specific file type, BinaryCoder gives the right explanation.  If you  need to  the source  code  about  how to,  read Simple shell context menu. This article demonstrates how to create a simple shell context menu using a few registry entries. It shoulds satisfy your requirement.

Best regards,
Riquel





Please remember to mark the replies as answers if they help and unmark them if they provide no help.

   Report Abuse  
  14 Feb 2008, 7:17 AM UTC
micd7
These stars recognize your participation in the forums. For more information about the different levels of stars, and how points are earned, please see the FAQ.


Posts 92
Re: windows explorer's context menu for files
Comment Was this post helpful ?
Reply Quote

This Thread is in the Visual Basic section, Not C#. Anyway Do you have a code snippet that can do something similar to adding an item to the windows explorer context menu similar to this? 

Open <filename> With Imager

 

Replacing <filename> with whatever the file's name and extension is.


   Report Abuse  
 Page 1 of 1 (5 items)
MSDN Forums » Visual Basic » Visual Basic General » windows explorer's context menu for files

Subscribe to RSSSubscribe to RSS

© 2008 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
Microsoft