Re: Add a context menu item to Windows Explorer (Win98) with VB6?



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
.



Relevant Pages

  • Re: Right Click Crashes Windows Explorer
    ... Using Regedit I changed Powerdesk ... What about other shell extensions (not only Context Menu handlers). ... Ramesh Srinivasan, Microsoft MVP [Windows Shell/User] ... Explorer crashes. ...
    (microsoft.public.windows.vista.installation_setup)
  • Re: Windows Explorer rt-clicking results in termination
    ... Right-click is slow or weird behavior caused by context menu handlers: ... Windows XP Shell/User ... >I have been troubleshooting this situation for weeks w/o any success. ... > and Internet Explorer GUIs, but they also exhibit the same behavior. ...
    (microsoft.public.windowsxp.general)
  • Explorer crashes with pbxml file
    ... I have a problem with my XP SP2 explorer. ... shift-F10) at a pbxml file to open the context menu the explorer windows is ... When I remove this file I can open the context ... the DLL explorer windows will be closed again when opening context menu. ...
    (microsoft.public.windowsce.platbuilder)
  • update on SP2 right-clicking problem
    ... SP2 the Explorer process would crash every time ... I have progress of sorts to report. ... under SP2, but for some bizarre reason, the context menu ...
    (microsoft.public.windowsxp.general)
  • Re: Problem with dev_kfree_skb_any() in 2.6.0
    ... >> Luckily, I feel there is an easy solution, as shown in the attached ... >> hard IRQ context, otherwise it will follow the expected path. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)