Re: Query shell-verbs and associations
- From: Alexander Mueller <millerax@xxxxxxxxxxx>
- Date: Wed, 05 Dec 2007 14:53:24 +0100
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.
- Follow-Ups:
- Re: Query shell-verbs and associations
- From: mayayana
- Re: Query shell-verbs and associations
- References:
- Query shell-verbs and associations
- From: Alexander Mueller
- Re: Query shell-verbs and associations
- From: mayayana
- Query shell-verbs and associations
- Prev by Date: Re: Garbage collect (or what?)
- Next by Date: Re: Query shell-verbs and associations
- Previous by thread: Re: Query shell-verbs and associations
- Next by thread: Re: Query shell-verbs and associations
- Index(es):
Relevant Pages
|