473,326 Members | 2,438 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Context Menu & Shell

I understand how to edit the registry to add context menu items in windows
for any file type. I know I can use %1 for the default value of the command
key to signify the filename that has been clicked on.

However, if I select multiple file names then the executable given in the
default value is called multiple times. Is there an option other than %1
which will send all the filenames to the executable in one command line?

Thanks!
Nov 21 '05 #1
2 1487
I have a need to edit the registry to add an item to a context menu. Do you
have any sample code on how to add this to the registry and then execute an
application when the item is clicked? Thanks for any reply.

"elziko" wrote:
I understand how to edit the registry to add context menu items in windows
for any file type. I know I can use %1 for the default value of the command
key to signify the filename that has been clicked on.

However, if I select multiple file names then the executable given in the
default value is called multiple times. Is there an option other than %1
which will send all the filenames to the executable in one command line?

Thanks!

Nov 21 '05 #2
>I have a need to edit the registry to add an item to a context menu. Do you
have any sample code on how to add this to the registry and then execute
an
application when the item is clicked? Thanks for any reply.


Well I don't really have any sample code but to do it manually I do this:

1) In HKEY_CLASSES_ROOT find the extension you require to add a context menu
item for. In my case it was ".dll". In this key find the value for the
default item. In my case it was "dllfile".

2) Still in HKEY_Classes_ROOT find a key for the value you have just looked
up ("dllfile").

3) Under this key add another key called "Shell".

4) Under this key add another with the name that you wish to appear ont he
context menu. In my case I want to open an app that will register the DLL so
I called it register.

5) Under this key add a key called "command"

6) Set the value of the default item for the "command" key to the path to
the executable you wish to run. Remember to encase it in quotes if there are
going to be any spaces and you may follow it with a "%1" (include the quotes
here too) to pass the selected file to the executable on the command line.

Obviously this would be easy to write in code.

So for my example, an export of this part of the registry looks like this:
-------------
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\dllfile\Shell\Register\Command]
@="\"D:\\Projects\\Visual Studio Projects\\MyExecutable.exe\" \"%1\""
-------------

You can also pass other stuff in other than the file name of the file but
you'll have to look this up on MSDN.

Hope that helps..... does anyone have any ideas on my original question?
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tom Dacon | last post by:
"Open .Net Command Window Here" context menu for Windows Explorer: The reg file described below adds a new menu item to Windows Explorer's context menu when you right-click over a folder (or the...
4
by: ssg31415926 | last post by:
I've got a ListView which can show many different types of object. I need to display a ContextMenu whose MenuItems depend on the object type. I was planning to pre-create the ContextMenus when...
4
by: yxq | last post by:
Hello Can anyone tell me Context Menu shell extension? It is better that provide some samples or links. Thanks
5
by: lgbjr | last post by:
Hello All, I have several Pictureboxes (linked to an AccessDB) on a VB.NET form. I would like to use a context menu to allow the user to open the picture in their default picture viewer or...
2
by: Martin Carpella | last post by:
Hi! Can anybody give me a pointer if/how I could retrieve the Explorer context menu of a given file in C#? Thanks in advance, Martin
3
by: Steven | last post by:
Hello, I want to a context menu extension dll like WinZIP, and it supports Windows Vista 32bit & 64bit. Where is it? Thank you Steven
3
by: Poggs | last post by:
Hi everyone, I used the pattern for Shell Extensions for Context menu from Dino Esposito's article. However I implemented it in more than one application and it seems that those two right click...
1
by: zacks | last post by:
I have figured out how to add custom menu items to various buildin context menus by looking at a project on CodeProject.com and then doing some registry searches. But I can't find how to add a...
0
by: sony.m.2007 | last post by:
Hi, I'm trying to add a contextmenu(adding my custom context menu) to windows explorer. This context menu has to be shown for all files and folder Th new context menu will be like this ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.