Re: Add a context menu item to Windows Explorer (Win98) with VB6?
- From: MM <kylix_is@xxxxxxxxxxx>
- Date: Tue, 21 Oct 2008 10:02:56 +0100
On Mon, 20 Oct 2008 18:13:15 -0700, "Steve Gerrard"
<mynamehere@xxxxxxxxxxx> wrote:
mayayana wrote:
But would that work for several files? That is, I select a number of
*.txt files and want to run a program that includes all of them?
For example, if I select right now three *.txt files and right-click,
then select QuickView, I just get three instances of Quick View, one
per file. That's no use to me. I want a piece of code to be run on
ALL of them. For example, select some files, then right-click, then
click on (imagined) "Rename extension to .GOP"
That's strange. I just tested it and found the same
result. I've never had occasion to use a multiple-file
method. I assumed that Explorer sends a null-delimited list
of paths when there are multiple selections. But I
just wrote a test program to show a msgbox of the
command line... created a context menu... selected three
files... clicked the context menu... and it did just as you say:
Explorer started a new instance for each file and I got
3 msgboxs!
I would think you could use App.PrevInstance to detect that an instance of the
app was already running, and reroute the subsequent Command parameters to the
existing instance, after finding it. Or something like that. Too much hassle?
Blimey! That really is going round the houses to get to the front
door! This task is mighty complex, as a whole book on the subject,
"Visual Basic Shell Programming" shows. There isn't an easy solution,
else the web would be crawling with 'em. And, believe me, before I
grabbed at that iContextMenu stuff like a drowning man clutching a
straw, I had spent several hours googling for suitable example code. I
found several for C++ and for .Net (since the context menu requirement
seems to be much better catered for in .Net), but practically nothing
for classic VB. Even having that book, mentioned above, before my
tired old brain and re-reading stuff like IShellExtInit, IContextMenu,
IDataObject and the various associated structures and so on, well, it
ain't a straightforward solution! ADO, for example, is far better
explained in countless books, far more approachable and with a far
bigger payoff. A simple little task like right-clicking an Explorer
menu just to manipulate a few files, however, and Microsoft makes it
as difficult and arcane as it could be.
MM
.
- References:
- Add a context menu item to Windows Explorer (Win98) with VB6?
- From: MM
- Re: Add a context menu item to Windows Explorer (Win98) with VB6?
- From: mayayana
- Re: Add a context menu item to Windows Explorer (Win98) with VB6?
- From: MM
- Re: Add a context menu item to Windows Explorer (Win98) with VB6?
- From: mayayana
- Re: Add a context menu item to Windows Explorer (Win98) with VB6?
- From: Steve Gerrard
- Add a context menu item to Windows Explorer (Win98) with VB6?
- Prev by Date: Re: Replace function doesn't work properly
- Next by Date: Re: Replace function doesn't work properly
- Previous by thread: Re: Add a context menu item to Windows Explorer (Win98) with VB6?
- Next by thread: visual basic 6 - help looping through checkboxes
- Index(es):
Relevant Pages
|