Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dynamic Context Menu

2 views
Skip to first unread message

Nando

unread,
Jan 2, 2010, 2:55:18 AM1/2/10
to
Happy New Year Everyone!

I wrote a small program to process some data files. I would like to
integrate its functionality to the Windows shell, so I can right-click
on these files and select options from the menu (just like WinZip does).

I have been playing with the registry, and successfully added
right-click functionality, but I can only do static menus. I would like
the menus to be dynamic, since the options will vary depending on the
content of the data file.

Is there any sample code that illustrates this? I have been searching a
lot, and all I can find are examples in Delphi and C++. I don't know
either, just some basic C (zero API). I would definitely prefer some
sample code in VB6 if possible (that's what I used for my application).
I appreciate your guidance. Thanks in advance.

-Nando

--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---

Nobody

unread,
Jan 2, 2010, 9:20:41 AM1/2/10
to

"Nando" <high...@att.net.no.to.sp.am> wrote in message
news:hhmu5h$ppl$1...@adenine.netfront.net...

Download the following sample files from the link below and install them:

Shell Extensions
Shell Extensions [FIX - Missing files]

You will also need to add this file as a reference in VB before opening any
of the samples. This needs to be done once to register the TLB:

OLELIB.TLB - OLE interfaces & functions v1.7

After installation and registering the TLB, look for the sample installed at
this folder:

C:\Program Files\Edanmo's VB Page\Shell Extensions\Context Menu

http://www.mvps.org/emorcillo/en/code/vb6/index.shtml

There are several Shell related samples installed to do everything that C
samples do. However, IShellExecuteHook was deprecated in Vista+, because it
allows blocking execution of programs that the user wants to run, but you
don't need it.


mayayana

unread,
Jan 2, 2010, 10:19:12 AM1/2/10
to
In addition to Nobody's link, if you happen
to have access to the book Visual Basic Shell
Programming (J.P. Hamilton, O'Reilly publ.)
it's all in there. That book provides simple
explanations and sample projects for all of
the basic shell extensions: BHOs, Explorer
Bars, Namespace extensions and various
handlers, including context menu handlers, which
is what you want.

Nando

unread,
Jan 7, 2010, 8:17:02 PM1/7/10
to
Nobody wrote:

> "Nando" wrote:
> news:hhmu5h$ppl$1...@adenine.netfront.net...
>> Happy New Year Everyone!
>>
>> I wrote a small program to process some data files. I would like to
>> integrate its functionality to the Windows shell, so I can right-click on
>> these files and select options from the menu (just like WinZip does).
>>
>> I have been playing with the registry, and successfully added right-click
>> functionality, but I can only do static menus. I would like the menus to
>> be dynamic, since the options will vary depending on the content of the
>> data file.
>>
>> Is there any sample code that illustrates this? I have been searching a
>> lot, and all I can find are examples in Delphi and C++. I don't know
>> either, just some basic C (zero API). I would definitely prefer some
>> sample code in VB6 if possible (that's what I used for my application). I
>> appreciate your guidance. Thanks in advance.
>
> Download the following sample files from the link below and install them:
>
> Shell Extensions
> Shell Extensions [FIX - Missing files]
>
> You will also need to add this file as a reference in VB before opening any
> of the samples. This needs to be done once to register the TLB:
>
> OLELIB.TLB - OLE interfaces& functions v1.7

>
> After installation and registering the TLB, look for the sample installed at
> this folder:
>
> C:\Program Files\Edanmo's VB Page\Shell Extensions\Context Menu
>
> http://www.mvps.org/emorcillo/en/code/vb6/index.shtml
>
> There are several Shell related samples installed to do everything that C
> samples do. However, IShellExecuteHook was deprecated in Vista+, because it
> allows blocking execution of programs that the user wants to run, but you
> don't need it.

Thanks Nobody, I'm studying the file and shell standards. I have not
finished my project yet, but I'm learning a lot! -Nando

Nando

unread,
Jan 7, 2010, 8:26:59 PM1/7/10
to

Thanks Mayayana, It's good to know that such references exist. I have
started to study the Windows shell details, and the info for VB is quite
scarce. That seems like a good book to learn about it, as I would also
like to add a new page tab for the files' property pages. -Nando

0 new messages