Adding shell extensions to registry

I'm trying to add menu items to the desktop's context menu.
I _think_ I have the necessary code, but I can't figure out
how to get the shell to initialize the DLL.  My guess is
I'm doing something wrong in the registry, but I'm stuck.
Below is what I'm using for a .REG file.  Please let me
know if there's anything wrong here.  Thanks in advance.  
(Please excuse the formatting of the .REG file.)

-----------------------------------------------------------
------------
REGEDIT4

[HKEY_CLASSES_ROOT\CLSID\{4d7e1cc0-292e-11d1-ab10-004005228
c6a}]
   @="Shell Extension Sample"
[HKEY_CLASSES_ROOT\CLSID\{4d7e1cc0-292e-11d1-ab10-004005228
c6a}\InProcServer32]
   @="c:\\src\\shellext\\shellext.dll"
     "ThreadingModel"="Apartment"

[HKEY_CLASSES_ROOT\CLSID\{00021400-0000-0000-c000-000000000
046}\ShellEx\ContextMenuHandlers]
   @="SESMenu"
[HKEY_CLASSES_ROOT\CLSID\{00021400-0000-0000-c000-000000000
046}\ShellEx\ContextMenuHandlers\SESMenu]
   @="{4d7e1cc0-292e-11d1-ab10-004005228c6a}"
[HKEY_CLASSES_ROOT\CLSID\{00021400-0000-0000-c000-000000000
046}\ShellEx\PropertySheetHandlers]
   @="SESProp"
[HKEY_CLASSES_ROOT\CLSID\{00021400-0000-0000-c000-000000000
046}\ShellEx\PropertySheetHandlers\SESProp]
   @="{4d7e1cc0-292e-11d1-ab10-004005228c6a}"

-----------------------------------------------------------
----------

LVL 1
twh270Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mattyg102096Commented:
So, you are trying to add an item to the Desktop menu, and then add property sheets to the Display Properties dialog that comes up if you select Properties.  Right?

Well, I cheated an looked at where my video card drivers (Matrox) make Registry entries for the property sheets.  The drivers add 2 sheets to my Display settings.

Well, it seems that for the Property Sheets, the proper key would be:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\Display\shellex\PropertySheetHandlers\SESProp]
@="{your CLSID here}"

Mind you, I've pulled this out of my NT registry, but since the key "path" references 'Windows' and 'Windows NT', I imagine that it hasn't changed from Win95.  I don't have a Win95 machine up and running to compare for sure though.

As for the Context Menu entries, perhaps they go in the same key?
0
twh270Author Commented:
Thanks for the reply.  That is a good answer, but I'm going to
have to reject it as it doesn't tell me anything I don't already
know.  Property sheets are "trivial" compared to the context
menu, apparently.  I have plenty of sample code that shows how
to do property sheets (and plenty of context menu sample code
too, actually - but none that shows how to subclass the desktop
menu.)  IIRC, your key is correct for the Display properties
sheet.  Just for kicks, I will try putting the context menu
shellex in the same key, but I would be very surprised to find
it worked.  If it does, you will get full credit for the answer;
if noone else is able to answer my question I will give you
partial credit.
0
vinniewCommented:
There is a sample called "power tools" on the MS web site.  The DOSHere piece has exactly what you want.  I don't have the install local anymore or i'd give it to you.  DOSHere is a .inf and .reg file combination that lets you start a command.com from a directory in the explorer, using a right click.

V

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
twh270Author Commented:
I can't find this on Microsoft's web site.  Can you tell me
where it is?

0
mattyg102096Commented:
I found the DOSHere piece at TuCows.  I don't think this is what you want.

1.  It adds a simple command option to the Context Menu.  i.e.  It uses the Shell\...\command.  This is like the entry for the Open, Edit, or Print options that appear on the menu.  In this case it adds a command that invokes COMMAND.COM with a specific set of command arguments that change the current directory to the location you invoked the menu for.

2.  This example adds the commands to the context menus for all drives and directories by adding the appropriate shell keys to HKEY_CLASSES_ROOT\Drive and HKEY_CLASSES_ROOT\Directory respectively.  This tells you nothing about adding to the context menu of the Desktop.  In the off chance that it did (i.e. the system treats the desktop like a directory, which in a way I suppose it is), it would not be limited to adding the item to the desktop menu... it would be added to all the menus for Drives and Directories.  Would this be appropriate?

In short, the point I was trying to make before was that I think you are on the right track.  From what I can tell at a glance,you are doing things right as far as WHAT you NEED to be adding... I just don't think that you're adding the keys in the right place.  The question here is "which registry key controls the desktop"... not "what do I put there"?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.