?
Solved

explorer context menu

Posted on 1998-02-18
3
Medium Priority
?
265 Views
Last Modified: 2010-04-04
How can I extend my app via explorer context menu. (like e.g. Winzip 6.3 does). User should be able to select multiple (.*) files and folders and call menu funtion in my .dll file. Please provide clear commented step-by-step code...
0
Comment
Question by:tremel
[X]
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
3 Comments
 
LVL 2

Expert Comment

by:mvz121697
ID: 1359527
If using Delphi 3, you can look at the contmenu - demo-application in  Delphi 3\Demos\ShellExt\

Greetings,
MvZ

0
 
LVL 5

Expert Comment

by:inter
ID: 1359528
To call a function from DLL you should override IContextMenu COM interface which is not very very easy. You should deal with OLE and shared memory. Instead (as winzip does). You can program an executable MyProg.exe which handles the job as follows:

Assume you want to Expand the selected files and in normal command line for this to be:(assume hypotetic zip file .dip)

MyProg.exe filename1.dip

Do these in the registry:


Then add this key to registry:

HKEY_CLASSES_ROOT\.dip with (Default) value MyProg

Then add this key

HKEY_CLASSES_ROOT\Myprog
  add sub key to it called 'shell'
    add sub key to it called 'open'
       add sub key to it called 'command' and set it
             to 'c:\path1\path2\MyProg.exe %1'
    add sub key to key 'shell' called 'edit'
       add sub key to it called 'command' and set it
             to 'c:\path1\path2\MyProg.exe %1'

Rename any unimportant file to extension '.dip'.

Now when you press right mouse button on a dip file you see the 'open' and 'edit' commands.

Thats it, but if you realy require to write special context menu handler this does not work.

Bye!
Igor
0
 
LVL 4

Accepted Solution

by:
d003303 earned 400 total points
ID: 1359529
Yo,

like MvZ and Inter mentioned, if you use D3, take a look at the context menu example. It is not that hard to write your own context menu handler. The only things to be modified from the example:
- create the project from scratch to get a new GUID !!!! (new ActiveX library)
- the Initialize method should accept multiple files. Store the file names in a temporary list.
- the REG file should be modified. Replace the GUID, the name of the dll file and the comments. The last lines should read
[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\{<here goes your GUID>}]
@= ""

Now your context menu is called everytime any file(s)/folder(s) is/are right-clicked.

Slash/d003303
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

765 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