Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > Weird behavior of ShellExecute on Vista

Reply
Thread Tools Display Modes

Weird behavior of ShellExecute on Vista

 
 
Mihai Ciumeică
Guest
Posts: n/a

 
      04-15-2008
Greetings, everyone. I apologize in advance if the question is off-topic in
here, but the only newsgroup here specifically about Windows Vista registry
is in German. So, here goes.

I'm developing an application that must at one point launch a user-given
file. So I open the registry, look under HKCR\{name of file type}\shell, get
the name of the default verb ('Play' for video files etc.), then look up the
appropriate handler (the program executable) in the verb's subkey, check if
I can launch the handler and then do so. Later I might, with the user's
permission, change it to another program, or add my own verb, or whatever.

The problem is, under Vista, these verbs don't work. They don't even show up
in the context menu. For example, when I right-click a video file, the
default action is 'Open', which launches my VLC media player. The default
action in HKCR\avifile\shell is 'Play', and the handler under
HKCR\avifile\shell\play\command is wmplayer.exe. I'm guessing the fact that
the 'command' key has a value called 'LegacyDisable' has something to do
with it.

So my question is, where exactly in the registry does ShellExecute look for
the default verb and its handler?

Thank you for your time.

 
Reply With Quote
 
 
 
 
Jon
Guest
Posts: n/a

 
      04-15-2008
"Mihai Ciumeică" <> wrote in message
news:...
> Greetings, everyone. I apologize in advance if the question is off-topic
> in here, but the only newsgroup here specifically about Windows Vista
> registry is in German. So, here goes.
>
> I'm developing an application that must at one point launch a user-given
> file. So I open the registry, look under HKCR\{name of file type}\shell,
> get the name of the default verb ('Play' for video files etc.), then look
> up the appropriate handler (the program executable) in the verb's subkey,
> check if I can launch the handler and then do so. Later I might, with the
> user's permission, change it to another program, or add my own verb, or
> whatever.
>
> The problem is, under Vista, these verbs don't work. They don't even show
> up in the context menu. For example, when I right-click a video file, the
> default action is 'Open', which launches my VLC media player. The default
> action in HKCR\avifile\shell is 'Play', and the handler under
> HKCR\avifile\shell\play\command is wmplayer.exe. I'm guessing the fact
> that the 'command' key has a value called 'LegacyDisable' has something to
> do with it.
>
> So my question is, where exactly in the registry does ShellExecute look
> for the default verb and its handler?
>
> Thank you for your time.




When you right-click a .avi file it first looks at the default key at

HKEY_CLASSES_ROOT\.avi

to determine where to subsequently jump to ie

HKEY_CLASSES_ROOT\{value of default key}\shell


In your case you would appear to have associated .avi files with VLC Media
Player, so you probably have a VLC entry there. Explore what values you have
under that key, and it will perhaps become apparent what's happening.

--
Jon



 
Reply With Quote
 
Bob
Guest
Posts: n/a

 
      04-15-2008
I know nothing about developing an application. Having said that, I think
you need to take a look at Control Panel>Default Programs.

Also when you right click a video file there is no default action. The
reason for right clicking the file is to choose an action other than the
default.
The default action occurs when you left click.


"Mihai Ciumeică" <> wrote in message
news:...
> Greetings, everyone. I apologize in advance if the question is off-topic
> in here, but the only newsgroup here specifically about Windows Vista
> registry is in German. So, here goes.
>
> I'm developing an application that must at one point launch a user-given
> file. So I open the registry, look under HKCR\{name of file type}\shell,
> get the name of the default verb ('Play' for video files etc.), then look
> up the appropriate handler (the program executable) in the verb's subkey,
> check if I can launch the handler and then do so. Later I might, with the
> user's permission, change it to another program, or add my own verb, or
> whatever.
>
> The problem is, under Vista, these verbs don't work. They don't even show
> up in the context menu. For example, when I right-click a video file, the
> default action is 'Open', which launches my VLC media player. The default
> action in HKCR\avifile\shell is 'Play', and the handler under
> HKCR\avifile\shell\play\command is wmplayer.exe. I'm guessing the fact
> that the 'command' key has a value called 'LegacyDisable' has something to
> do with it.
>
> So my question is, where exactly in the registry does ShellExecute look
> for the default verb and its handler?
>
> Thank you for your time.


 
Reply With Quote
 
Mihai Ciumeică
Guest
Posts: n/a

 
      04-15-2008
>> So my question is, where exactly in the registry does ShellExecute look
>> for the default verb and its handler?

>
> When you right-click a .avi file it first looks at the default key at
>
> HKEY_CLASSES_ROOT\.avi
>
> to determine where to subsequently jump to ie
>
> HKEY_CLASSES_ROOT\{value of default key}\shell
>
>
> In your case you would appear to have associated .avi files with VLC Media
> Player, so you probably have a VLC entry there. Explore what values you
> have under that key, and it will perhaps become apparent what's happening.


There's no mention of VLC in there. Where does the system look next, if it
finds LegacyDisable in the first location?
And here are the contents of the registry branch, edited for brevity:

[HKEY_CLASSES_ROOT\AVIFile\shell]
@="Play"

[HKEY_CLASSES_ROOT\AVIFile\shell\open]
"LegacyDisable"=""
[HKEY_CLASSES_ROOT\AVIFile\shell\open\command]
@="%ProgramFiles%\Windows Media Player\wmplayer.exe" /prefetch:8 /Open "%L"
[HKEY_CLASSES_ROOT\AVIFile\shell\open\DropTarget]
"CLSID"="{CE3FB1D1-02AE-4a5f-A6E9-D9F1B4073E6C}"

[HKEY_CLASSES_ROOT\AVIFile\shell\play]
@="&Play"
"MUIVerb"=@%SystemRoot%\system32\unregmp2.exe,-9991
"LegacyDisable"=""
[HKEY_CLASSES_ROOT\AVIFile\shell\play\command]
@="%ProgramFiles%\Windows Media Player\wmplayer.exe" /prefetch:8 /Play "%L"
[HKEY_CLASSES_ROOT\AVIFile\shell\play\DropTarget]
"CLSID"="{CE3FB1D1-02AE-4a5f-A6E9-D9F1B4073E6C}"

I might resort to just searching the registry for all mentions of .avi,
avifile and VLC, but, if nothing else, I'd like to help the next person
looking for the solution to this. :-)


 
Reply With Quote
 
Jon
Guest
Posts: n/a

 
      04-15-2008
Right-click on

HKEY_CLASSES_ROOT\.avi

choose export and paste the exported .reg file in here.


--
Jon


"Mihai Ciumeică" <> wrote in message
news:%23dBw%...
> There's no mention of VLC in there. Where does the system look next, if it
> finds LegacyDisable in the first location?
> And here are the contents of the registry branch, edited for brevity:
>
> [HKEY_CLASSES_ROOT\AVIFile\shell]
> @="Play"
>
> [HKEY_CLASSES_ROOT\AVIFile\shell\open]
> "LegacyDisable"=""
> [HKEY_CLASSES_ROOT\AVIFile\shell\open\command]
> @="%ProgramFiles%\Windows Media Player\wmplayer.exe" /prefetch:8 /Open
> "%L"
> [HKEY_CLASSES_ROOT\AVIFile\shell\open\DropTarget]
> "CLSID"="{CE3FB1D1-02AE-4a5f-A6E9-D9F1B4073E6C}"
>
> [HKEY_CLASSES_ROOT\AVIFile\shell\play]
> @="&Play"
> "MUIVerb"=@%SystemRoot%\system32\unregmp2.exe,-9991
> "LegacyDisable"=""
> [HKEY_CLASSES_ROOT\AVIFile\shell\play\command]
> @="%ProgramFiles%\Windows Media Player\wmplayer.exe" /prefetch:8 /Play
> "%L"
> [HKEY_CLASSES_ROOT\AVIFile\shell\play\DropTarget]
> "CLSID"="{CE3FB1D1-02AE-4a5f-A6E9-D9F1B4073E6C}"
>
> I might resort to just searching the registry for all mentions of .avi,
> avifile and VLC, but, if nothing else, I'd like to help the next person
> looking for the solution to this. :-)
>
>


 
Reply With Quote
 
Mihai Ciumeică
Guest
Posts: n/a

 
      04-15-2008
"Jon" <> wrote in message
news:#...
> Right-click on
>
> HKEY_CLASSES_ROOT\.avi
>
> choose export and paste the exported .reg file in here.


Never mind that; I just searched the registry and found an obscure key
called
HKEY_CURRENT_USER\Software\Microsof\Windows\Curren tVersion\Explorer\FileExts\.avi\UserChoice,
which pointed to VLC. Apparently, in Vista, changing a file association is
now a per-user setting. I'm sorry to have bothered you guys with what I
could've done myself, and thank you for replying.

 
Reply With Quote
 
Jon
Guest
Posts: n/a

 
      04-15-2008
"Mihai Ciumeică" <> wrote in message
news:...
> Never mind that; I just searched the registry and found an obscure key
> called
> HKEY_CURRENT_USER\Software\Microsof\Windows\Curren tVersion\Explorer\FileExts\.avi\UserChoice,
> which pointed to VLC. Apparently, in Vista, changing a file association is
> now a per-user setting. I'm sorry to have bothered you guys with what I
> could've done myself, and thank you for replying.



Interesting. That's a new one on me too, I must confess. Glad you've found
the culprit anyhow.

--
Jon



 
Reply With Quote
 
Ramesh, MS-MVP
Guest
Posts: n/a

 
      04-16-2008
Checkout the Per-user override here:

HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\FileExts\.avi

This applies to Windows XP as well as for Windows Vista.

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows Shell/User]
Windows® Troubleshooting http://www.winhelponline.com
Winhelponline.com blog http://www.winhelponline.com/blog


"Mihai Ciumeică" <> wrote in message news:...
Greetings, everyone. I apologize in advance if the question is off-topic in
here, but the only newsgroup here specifically about Windows Vista registry
is in German. So, here goes.

I'm developing an application that must at one point launch a user-given
file. So I open the registry, look under HKCR\{name of file type}\shell, get
the name of the default verb ('Play' for video files etc.), then look up the
appropriate handler (the program executable) in the verb's subkey, check if
I can launch the handler and then do so. Later I might, with the user's
permission, change it to another program, or add my own verb, or whatever.

The problem is, under Vista, these verbs don't work. They don't even show up
in the context menu. For example, when I right-click a video file, the
default action is 'Open', which launches my VLC media player. The default
action in HKCR\avifile\shell is 'Play', and the handler under
HKCR\avifile\shell\play\command is wmplayer.exe. I'm guessing the fact that
the 'command' key has a value called 'LegacyDisable' has something to do
with it.

So my question is, where exactly in the registry does ShellExecute look for
the default verb and its handler?

Thank you for your time.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird Virtual PC behavior teddysnips@hotmail.com Windows Vista General Discussion 1 04-04-2008 11:54 AM
Weird search behavior? Nigel Molesworth Windows Vista Mail 0 02-03-2008 01:47 PM
Weird Behavior After Long Run Stephensaw Windows Vista General Discussion 1 09-19-2007 04:42 AM
Weird behavior when printing englishsoup Windows Vista Mail 3 04-12-2007 01:36 PM
Howto fix weird menu behavior? Jackfish Windows Vista General Discussion 0 03-01-2007 06:14 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59