Link to home
Start Free TrialLog in
Avatar of dgrafx
dgrafxFlag for United States of America

asked on

right click menu additions

If a person has Windows Media Player set as the default program to open certain file types - let's use .mp4 for ex - then it seems there is some type of prevention by Windows to adding context menu items via the registry.

The question then is how can a person add a right click menu item in this scenario I just described?

NOTE:
Do not describe how to add a right click menu item - I know how to add a right click menu item.
You may need to set this up on your own computer to see what I'm talking about.
Also do not post any 3rd party solutions - that's not what I want - I want to figure out what the story is with this.
Avatar of Santosh Gupta
Santosh Gupta

Hi,

your question is- "how can a person add a right click menu item in this scenario I just described?"

and you are also stating "Do not describe how to add a right click menu item - I know how to add a right click menu item. "

So bit confused what are looking for... please explain.
Avatar of dgrafx

ASKER

it appears that you were going to post some instructions - either from an article about how to add context menu items or from your own knowledge.
but then when i said DON'T do that you are confused.
so now after reading below - and re-reading my question you can now see why I said don't want you to just post the usual instructions on context menu how to.

================================

did you read the first paragraph?

do you have a file type on your computer whose default program is WMP?

IF you answer yes to both of those questions then go ahead and create a right click menu item for that file type and post back here as to your success.


Note that I'm not speaking of any other scenarios - just this one!
User generated image
Now... ?
Avatar of dgrafx

ASKER

ok - I assume you are saying that .mp3's default program is WMP - correct?

If yes - then try and create a context menu item - name it "Testing" and have it open anything you choose ...
If yes - then try and create a context menu item - name it "Testing" and have it open anything you choose ...

what are you trying to achieve?
if you are looking to open with something other than WMP then go to the "open with" menu option for a list of installed applications that can play it
I don't see that problem here. I have MP4 associated with WMP. Here's the MP4 context menu:

User generated imageAs you can see, numerous items have been added to the context menu. If you really think the association of MP4 with WMP is the problem (which I doubt), you could test that theory by associating MP4 with some other program and then seeing if you can add context menu items. Regards, Joe
so you want to open the .mp3 file with "testing" option or all extension files with "testing" option.

if only for .mp3 then which program should open it after clicking on "testing" ?
Avatar of dgrafx

ASKER

Santosh - just add testing to the context menu just to see if you can - that is 100% of the issue - I'm not really going to add an item named testing.

Joe - that appears to be the context menu when you have your file associated with VLC - Not WMP

Seth - that's not what I'm doing ...
> Joe - that appears to be the context menu when you have your file associated with VLC - Not WMP

Nope! It is associated with WMP:


User generated imageVLC (and MediaInfo, 7-Zip, Notepad++, Mp3tag, etc.) added context menu items, but as you can see in the above screenshot, MP4 is associated with WMP. Regards, Joe
Avatar of dgrafx

ASKER

OK Joe - let's say that if you double click an mp4 it opens with WMP ...

then on to my question: can you add a listing to the right click menu - just use "testing" as the name and have it open any program you want.
> OK Joe - let's say that if you double click an mp4 it opens with WMP ...

Yes, it does.

> can you add a listing to the right click menu

It's obvious that it can be done, since programs like VLC, MediaInfo, and Mp3tag have done it. That said, how would you like me to add one?
This thread is pretty much a duplicate of
https://www.experts-exchange.com/questions/28389327/adding-context-menu-problems.html?anchorAnswerId=39932717#a39932717

Many suggestions have been made.

One of the problems is that we do not know what dgrafx wants to add to the Context Menu.  Perhaps his installation of WMP is corrupt.
Avatar of dgrafx

ASKER

Joe - add it manually as I said.
Just use "Testing" as the name and it can open with any program you choose.

jcimarron - please don't contaminate this thread. I had to open a new thread because you kept posting in the other thread refusing to understand what I was talking about and now you come here - right when we are making progress - and act all confused again.
do not post any further - I may be on the verge of an answer.
User generated image
now what ?
Avatar of dgrafx

ASKER

ok - so show me how to add that ...
Avatar of dgrafx

ASKER

ok so that shows for ALL files!
That was posted in the other thread I have open.

Can you figure out a way to add this exact feature for specific files only?
Remember - this is easy EXCEPT for when WMP is the default program for that file type.
> add it manually

I presume you mean by modifying the registry, which I'm not willing to do. I do it when necessary, but I tend to the very conservative side in modifying the registry. Back to my earlier comment — if you really think the association of MP4 with WMP is the problem, test that theory by associating MP4 with some other program and then see if you can add context menu items. If you still can't add items, then the association of MP4 with WMP is not the culprit.

> this is easy EXCEPT for when WMP is the default program for that file type

What are the exact steps you use when it is "easy"?
Go the target...

do the same thing but at new location.

User generated image
That was posted in the other thread I have open.

what is the difference with this and the other thread you have on this subject?

https://www.experts-exchange.com/questions/28389327/adding-context-menu-problems.html
I suspect dgrafx's installation of WMP is corrupt, since it has been shown by Joe Winograd with a screen shot that having WMP as default for .mp4 files does not cause problems with the Context Menu.  (I also have no problems.)
Avatar of dgrafx

ASKER

in reference jcimarron post: ignore his posts please! I do not have a problem - I'm trying to do something custom that I am having difficulty doing!

Joe - I understand - and yes I modify the registry.
IF say for example you have VLC set as default program for a file type - let's use mp4 - then you can simply follow a couple steps that are all over Google - like here: http://www.howtogeek.com/107965/how-to-add-any-application-shortcut-to-windows-explorers-context-menu/
That is the standard method.
Note that it doesn't work IF WMP is the default program for that file type.

santosh - ok I see the method - same as what I use - but does it actually work when you right click? screenshot?

seth - there was no intended difference - but couldn't get the people there (ahem) to understand what I was talking about so created this thread because once a bunch of posts exist in a thread it is rare that new people will come on board. contaminated ya know ...

thanks guys - i believe we are close!
dgrafx--
"in reference jcimarron post: ignore his posts please! "

Yes, that is what you have done all along.

Since we have no idea what command(s) you want to add to the  .mp4 Context Menu, it is hard to help.
Avatar of dgrafx

ASKER

jcimarron - it is not hard for anyone else - i can't figure out why you think it matters ...
dgrafx

You were asked by jcimarron in your other question what the Default value was directly under the registry key:
[HKEY_CLASSES_ROOT\.mp4]
but I don't believe you answered that.

The name of that value dictates where the normal right-click options are fetched from in the registry for that file type.

If the value is "Mp4File", then you would create your new    ActionName\command    keys and respective values under the key:
[HKEY_CLASSES_ROOT\Mp4File\shell]

Example:
[HKEY_CLASSES_ROOT\Mp4File\shell\NotepadEdit\command]
and would add your command to Notepad as the Default Value in the "command" key.  Whatever text you wanted to display for this new menu option would be added as the Default value under the "NotepadEdit" key.

It's that simple, and is exactly what jcimarron explained in your other question.

Be aware, of course, that different programs may change the value name in:
[HKEY_CLASSES_ROOT\.mp4]
and therefore any new keys and values created under the key that matches the previous value will be ignored.
Avatar of dgrafx

ASKER

BillDL - it's possible that I didn't answer that ...

In the case of what I'm talking about that doesn't matter as (once again I'm explaining this) when WMP is the default program then all that is ignored!
IF one changes the default program to something other than WMP then what you are referring to is valid again.

here - let me say this again ...
IF WMP is the default program then all you knew about this subject is useless!
I am wanting to know "what is up" - Capisce ???

Afraid it's not that simple (for some to understand the issue anyway) ...
Sì, capisco perfettamente. Io non sono stupido.
I just tested this on my Windows 7 PC, with Windows Media Player set as the default, and it works perfectly well.  I am sorry that yours doesn't.  Goodbye.
Avatar of dgrafx

ASKER

goodbye BillDL - sorry to see ya go ...
Have you tried it on another computer? Or how about creating a new user account on the same computer? Maybe your current user account is corrupted in a way that affects the context menu. Although I haven't tried it myself, BillDL said, "I just tested this on my Windows 7 PC, with Windows Media Player set as the default, and it works perfectly well." So there's likely something in your environment causing the behavior you're seeing. It may be corruption, or it may be another program that is causing a conflict.

Btw, I followed the instructions in the HTG link you posted. The default for MP4 is <WMP11.AssocFile.MP4>. I then went to the <HKEY_CLASSES_ROOT\WMP11.AssocFile.MP4\shell> key and found <AddToPlaylistVLC>, which at least shows that a context menu item was added to MP4 files. I'm thinking about breaking my "change the registry only when necessary" dictum and adding an item for a video editing program called VideoReDo, but in the meantime, let me know how you fare. Regards, Joe
Avatar of dgrafx

ASKER

Thanks Joe
Let me know if you have success
I'm still waiting for Santosh as it seems he is the closest to what I'm trying.

Yes - I have tried on other computers - this isn't a new issue - I've just never said anything before ...

And no I don't believe those guys that posted saying it works fine for them.
You can see their attitude - a couple of buddies imagining themselves ganging up just to prove me wrong - for whatever reason ...
ASKER CERTIFIED SOLUTION
Avatar of Joe Winograd
Joe Winograd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
One thing that has never been made absolutely clear is whether the new right click menu option fails to show, or whether it shows but the command doesn't work (with or without an error).  Sometimes you have to "tweak" the actual command by double quoting the path but not the %1, vice versa, both, or neither double quoted.  Despite this the new context menu option should still show if done properly on a computer that doesn't have other issues.

The screenshot by Santosh Gupta isn't the Holy Grail here.  It simply shows exactly what was originally suggested by others in both your questions, shows just what I did, and what Joe has just demonstrated.

Just so you know, I have tinkered with Windows like this since 1995 and am intimately acquainted with registry tinkering.  This is about the most basic task you can get, and I can do it with my eyes shut.

I would have been inclined to stick around and try to get to the bottom of why it isn't working for you, but I didn't appreciate being spoken to as though I am an idiot and therefore dropped out.  You have just compounded the insult by calling me a liar, so I am now unsubscribed.
yes, it actually work when i right click, i used "vlc.exe %1" as default value to open it with vlc player.
Avatar of dgrafx

ASKER

Joe - what you said this last time prompted me to look at something - which turned out to be the solution.
You see - in the standard method of adding context menu additions you first start with the text of the default key of the file type - like .mp4 might have the text mp4file.
you then go to mp4file expand it and under shell add your new entry - then under that add a command key and set it's default key with the program you want this new key to open.
no problem
except in my case this wasn't adding up.
so after Joe's comment I searched for WMP11.AssocFile.MP4 and proceeded to follow the above directions I just gave.
Note that the wmp11 string was not listed as being associated with .mp4.
So i guess that was the meat of the question - WHERE is this hiding ? since it was not listed in the .mp4 file type.

I need to point out that I was experimenting - not having problems - and this is the same scenario on a win 7 laptop, a win 7 pc, and a win 8 laptop.
And that it occurred with any file type where I set WMP as the default program "always open with" ya know ...

anyway ...
@ dgrafxP, so my solution did not worked ??
Avatar of dgrafx

ASKER

Santosh - read what i wrote - the explanation i gave ...
> Note that the wmp11 string was not listed as being associated with .mp4.

That's very interesting! Can't say that I understand why it's happening. Thanks for posting. Regards, Joe
Santosh and Joe

I believe that the reason for this is because there are two entirely different areas of the registry being used.  One is a setting that affects "all users", and the other "user" setting that overrides the "all users" one.

When you do this on an MP4 file:
Right-click > Open With > tick the "always use this program" > select WMP > OK
it adds the    "Application"="wmplayer.exe"      value to the following registry key:

[HKEY_USERS\<SID>\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mp4]

where <SID> is the Security Identifier number for your user profile, and takes this format:
S-1-5-21-284907252-652377826-525346643-1004

This key and value is then replicated in the "Current User" key when you are logged on, sometimes immediately and sometimes only after a Windows Explorer refresh, or even only after a reboot.  In most cases it should be immediate.  So you now have:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mp4]
"Application"="wmplayer.exe"

This user setting overrides the "All User" setting under:
[HKEY_CLASSES_ROOT\.mp4]

Delete the "Application" value, and the association will revert to using whatever the Default REG_SZ value is in the aforesaid key.

So, even if you still had a Default REG_SZ value in there named "VLC.mp4", the new user setting created by ticking "always use this program to open files of this type" takes precedence and MP4 files will open in Windows Media Player.

This is not to be confused with the key:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mp4\OpenWithList]

which is used to display recently used programs in the Right-Click > Open With menu list and dictate the sort order for these menu items.

However, when you add a new "verb\command" keys and values to:
[HKEY_CLASSES_ROOT\WMP11.AssocFile.MP4\shell]
this then overrides the "per-user" key described above.

There are several ways in Windows to "set a program as default", the most common being via file association tick-boxes in the application's User Options if available, but unfortunately it never came to light in this question or the other one that the Right-Click > Open With tick box had been used to set MP4 to always open with WMP.  It was just reiterated that "WMP is set as the default for MP4s", and therein lies the problem with solving this kind of problem.

In Windows 7 I would always recommend that a user changes file associations either via the application's "file associations" user options, or as follows to maintain a consistency in where the registry settings are written rather than create them manually in Regedit:

Start button > Default Programs .
Click Associate a file type or protocol with a program.
Click the file type or protocol that you want the program to act as the default for.
Click Change program.

Click the program that you want to use as the default for the file type you selected, or click the arrow next to Other Programs to show additional programs.

If you don't see Other Programs, or your program is not listed, click Browse to find the program you want to use, and then click Open.
@ BillDL, Thanks for sharing notable information.
You're welcome Santosh.
Bill,
Great stuff! Thanks for sharing. Regards, Joe
Whoops, I need to make a correction and also clarify something that I didn't explain properly whilst typing from memory of Win7 on an XP computer.

First of all the concept of the "Program ID".   An OpenOffice document might be defined in the registry as a "OpenOffice.org.Doc", an MP4 file "MP11.AssocFile.MP4", and a Windows Installer package as an "Msi.Package".  These are referred to as the Program IDs.  Some are lengthy and contain one or more puctuating dots, whilst others are very simple like the program ID of "giffile" for a *.GIF image file.

When considering how file extensions are associated with program commands, it is this ProgramID that binds them together and cross-references things so that associations don't have to be repeated in multiple registry keys.

I referred to a registry key from memory in the previous comment, but left out an important sub-key named "UserChoice" which is found in Windows 7 (maybe Vista) but not in XP.

While associated with Windows Media Player 11 on Windows 7, having been set as the default program using the Right-Click > "Open With" option where the box has been ticked to always make the choice apply to MP4 files, this is the key that contains the "per-user" setting:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mp4\UserChoice]
"Progid"="WMP11.AssocFile.MP4"

The ProgID is value is often the program name on a WinXP system, but more often is the proper "identifier" name for the extension as shown above.

The registry key:

[HKEY_CLASSES_ROOT\WMP11.AssocFile.MP4]

will exist as the place where all references to this ProgID need to come to find instructions while the MP4 file is being referred to as a Windows Media Player file type, either from the HKEY_CLASSES_ROOT\.mp4 key or from the [HKEY_CURRENT_USER\..\UserChoice] key mentioned above, depending on how the association was created.

Hmmm.  I didn't explain this very well either, did I.  Hopefully it will correct my earlier comment, even if the complexities are over the heads of some readers.
Bill,
Thanks again for posting. You're right, though — a lot of it is over my head. But I always like learning! Regards, Joe