Tech Support > Microsoft Windows > Development Resources > Default shell action
Default shell action
Posted by Sin on October 15th, 2003


Hello everyone,

I'm currently writting a program which has a file pane that mimics
Explorer's file pane. This is done in VB, but it shouldn't make any
difference I suppose. I'm currently using registry functions to determin
what shell actions are supported for a file to fill in the context menu of
that file.

In Explorer, the default action has it's font set to bold and I would like
to mimic that. I've read that the first entry to have been added to the
registry is the one that is the default. I haven't found a way to determin
this... It doesn't seem to be the order in which they are listed, since my
observations contradict this. They also seem to be sorted alphabetically.

While I'm at it I'd like to know where and how I can extract the text
associated with default actions (open, print, etc). Those actions are the
only ones which do not have a value for the caption and I suppose they are
available somewhere?

Finally, I would like to know how to programmatically call the Properties
box, and if possible the "Open With" box for a file... I also noticed some
extenions have a second level of menu (bmp has Paint, Photoshop, Explorer,
etc). I haven't found a way to get these from the registry.

Any help would be appreciated.

Thanks alot!

Alex.


Posted by Kunal Gangakhedkar on October 15th, 2003


Well, the Windows Operating System defines an entire set of API
functions for shell interaction.
You can find the details about how to interact with the shell in MSDN.
Just search for topics like "Shell Programmers Guide", or "Programming
the shell".

BTW, what you're trying to do is use the shell functions only, in the
application specific manner.
If you're comfortable with VC, I'd suggest you have a look at
shellapi.h header file.

Unfortunately, most of the functions are not defined in the
Win32API.txt(for API Text Viewer), for interfacing with VB. So, you'll
have to do the dirty work of identifying the functions you want to
use, finding out which libraries they are part of (mostly shell32.dll
or shell32.lib) and add the respective "Declare Function..." entries
in your modules.

Rest of it is just playing around with your menu object(making the
entries bold, sorting it and so..).
Also, check for subjects like DDE in MSDN, for more information about
Data Exchange.

Hope this helps....

- Kunal Gangakhedkar
bombay, India


Similar Posts