Solved

explorer context menu

Posted on 1998-02-18
3
261 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 200 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Working this component WebCopy with proxy, help 3 84
How to debug For loops? 3 49
Find and Replace Stream with 0s 8 62
How to convert memory stream to PDF file 6 51
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

806 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