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


Add an item in the Win shell menu

Posted on 1999-07-30
Medium Priority
Last Modified: 2010-04-04
Hi Expert
I'd like to add an item in the Windows popup menu.
I click with the right mouse button over an icon and if it was a *.txt then I would like to show an item in the popup menu (ex: "Convert"). Then if I click on that item and Windows will lunch my application with the text file as parameter (ex: myapp.exe mytext.txt)
Is my question clear ? I'm sorry bu my english is not so good as I would like.

Question by:borgo
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
  • 5
  • 2
LVL 13

Expert Comment

ID: 1392065
You don't need to program here. It's pure registry stuff.

for example put this in a file named notepad.reg and double-click on it.


@="c:\\windows\\notepad.exe \"%1\""


LVL 17

Accepted Solution

inthe earned 120 total points
ID: 1392066
If all you need is a link to your app, then add the reg key:
HKCR\*\Shell\<your menu item>\command\(default)=<your command line>
For exemple, the following will add a 'Open with Notepad' menu to every file context menu:
HKCR\*\Shell\Open with notepad...\command\(default)='notepad "%1"'

There's an example for both Delphi 3 and 4 in the Demos directory; in D3, it's in Demos\ShellExt, D4 has it in Demos\ActiveX\ShellExt. In both cases, it's ContextM.Pas.
Regards Barry

LVL 17

Expert Comment

ID: 1392067
sorry epsylon
your comment werent there a minute ago???
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 13

Expert Comment

ID: 1392068
Uses ComObj;

CreateRegKey('*\shell\Notepad\command', '', 'c:\windows\notepad.exe "%1"');

Does the same....
LVL 13

Expert Comment

ID: 1392069
Never mind, Barry   :o)
LVL 13

Expert Comment

ID: 1392070
In your case that will be:

CreateRegKey('textfile\shell\Convert\command', '', '"c:\program files\MyApp\MyApp.exe" "%1"');

LVL 13

Expert Comment

ID: 1392071
Oops!!!   txtfile  not textfile

CreateRegKey('txtfile\shell\Convert\command', '', '"c:\program files\MyApp\MyApp.exe" "%1"');


Author Comment

ID: 1392072

Thank you a lots Inthe.

Thanks also go to Epsylon.


Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

664 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