Re: Query shell-verbs and associations

Tech-Archive recommends: Fix windows errors by optimizing your registry



mayayana schrieb:
I have some questions concerning ShellExecute(Ex)

- How can I enum / check the verbs that are supported for a given
file-extension? In detail i want to call the "edit" verb for
many filetypes. If there is no "edit" i want to call "open".
How do I know if the verb "edit" is supported?
Is there a more handy set of functions then RegQueryValue and RegEnumKeys?


I don't know whether this is really any easier
than checking the Registry, but I think it will
work. It uses the Shell object. My sample code
is a quick, late-bound script version, but it can be
done with a reference to Microsoft Shell Controls
and Automation rather than using CreateObject:


Hi mayayana

thanks for your suggestion. Unfortunately I shall
not use another COM-object. Some users still have NT4
where afaik Shell-automation isn't supported (
unless you a special IE-ver is installed) .

Also afaik the Verb-Names include ampersands and
are afaics also localized ("edit" becomes
"&Bearbeiten" for instance).

Thanks anyhow. I thought Shell-automation is a lightweight wrapper
around Shell-API. Unfortunaetly i couldn't find
an interface of function that corresponds to
FolderItemVerbs.

MfG,
Alex





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

Dim SHAp, oFol, oFolItem, FIVerbs, oVerb, s1, i2
Set SHAp = CreateObject("Shell.Application")
Set oFol = SHAp.NameSpace("C:\")
Set oFolItem = oFol.ParseName("icon1.gif")
Set FIVerbs = oFolItem.Verbs
For i2 = 0 to FIVerbs.count - 1
Set oVerb = FIVerbs.Item(i2)
s1 = s1 & oVerb.Name & vbCrLf
Next
MsgBox s1

Set FIVerbs = Nothing '-- FolderItemVerbs object.
Set oFolItem = Nothing '-- FolderItem object.
Set oFol = Nothing '-- Shell folder object.
Set SHAp = Nothing
----------------------

I *think* that works if run as a VBS. I'm onWin98
right now, where the Verb object doesn't seem to
be valid, so I can't test it. But I think it works
on 2000/ME/XP.




.



Relevant Pages

  • Re: Query shell-verbs and associations
    ... How do I know if the verb "edit" is supported? ... Set FIVerbs = Nothing '-- FolderItemVerbs object. ... Set oFolItem = Nothing '-- FolderItem object. ...
    (microsoft.public.vb.winapi)
  • Re: WinXP: filetype assoc without an "edit" verb no longer causes ShellExecuteEx to fail
    ... there seems to be no easy way to know if the verb you are ... users will often change their settings to ... often .jpeg files have an "open" handler for image files ... which is different than the default "edit" for Image types. ...
    (microsoft.public.win32.programmer.ui)
  • Re: Distal / polite
    ... I can't get used to the idea that one verb can substitute another verb, and even if it could, what would it substitute that other verb *for*? ... and another user called Exploding Boy helped me get it into quite a good shape. ... willing to edit when some manga fans with fairly limited knowledge seem quite happy to come along and trash or remove things just because they can't understand them. ... Not atoms, *particles* like electrons and neutrons which go together to make up the atoms which go together to make up the molecules. ...
    (sci.lang.japan)
  • Re: Directly open a .pps file for editing
    ... new verb, &Edit, for .pps, so I can do it via the context menu. ...
    (microsoft.public.powerpoint)
  • Re: Off Topic for this forum, Im sure, but how do I edit the HTML editing programs in IE6?
    ... You'll want to ask in the Windows or Internet Explorer newsgroups. ... suspect that being listed in the registry supporting the "EDIT" verb on HTM ...
    (microsoft.public.office.setup)