?
Solved

explorer context menu

Posted on 1998-02-18
3
Medium Priority
?
269 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
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
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

862 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