Link to home
Start Free TrialLog in
Avatar of sxh
sxh

asked on

Right Click Context - Passing Parameters

hi all

I would like to know the exact steps in producing the following:

By right-clicking on a drive, .lnk, .exe, .dll or any other file or icon, the explorer popup menu shows me a menu selection called 'testing sxh'.

When 'testing sxh' is selected, the resultant selected object's parameters are passed to a program which displays a form showing the object name and it's path.

Also i would like to know the exact registry entries (shell, shellex etc) and any CLSID keys.

The receiving program must be a .exe and not a .dll

:edited text:
Must be Delphi 3 for win95/win98
:end edited text:

awaiting your comments

regards

sxh
Avatar of sxh
sxh

ASKER

Edited text of question
An example of how to create a shell context handler is shipped with Delphi 3. Just take a look at the samples. I think the project in question is located somewhere in the Shell Extensions subfolder.

Regards,
Freter
Avatar of sxh

ASKER

hi Freter

I looked at the samples available before posting this question and found that:

1. they are both .dll files with exported functions

2. the contmenu.dpr only compiles dpr files when selected, it  does not support selection of any type of object.

3. the copyhook.dpr just hooks into some standard file  processing features.

4. the projects have pre-made .reg files created which do not say why the keys included are being used and for what purpose, eg where would i place a key ContextMenuHandler for .lnk files.

What parameters would i need to specify in the shell\command value, I have seen some that say;
     
     myprog.exe /idlist, "%1", "%L".

what does the /idlist mean, is it something to do with enumeration of the IDLIST ?.

regards

sxh

 
ASKER CERTIFIED SOLUTION
Avatar of nova666
nova666

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sxh

ASKER

Thanks nova666

That answered my question and I award you the points.

There is one question though, when a .lnk file is selected, it shows the name of the penultimate file and not the .lnk file name and path. eg .lnk = myprog.lnk -> myprog.exe, the program shows myprog.exe not myprog.lnk.

regards

sxh
You can of course add the registry settings for 'lnkfile', too:

[HKCR\lnkfile\shell\testing.shx]
@="Testing SHX"

[HKCR\lnkfile\shell\testing.shx\command]
@="c:\\shellext.exe \"%1\""

If you do so, the option "Testing SHX" appears twice in the context menu, one time for the .LNK file itself, and another time for the file the shortcut points to. I don't know how to turn this off..... sorry!

nova666