2

Editing the Registry for .mp3 file, with refrence from answer given here : Create registry entry to associate file extension with application in C++

i wrote the following code in c++ , to add open_wihtNewAPp in contex menu for .mp3 files.

Registry::SetValue("HKEY_CURRENT_USER\\Software\\Classes\\mp3file\\shell\\open_wihtNewAPp\\command", nullptr, "C:\\Users\\Devansh\\Desktop\\GUI.exe \"%1\"");
    Registry::SetValue("HKEY_CURRENT_USER\\Software\\Classes\\.mp3", nullptr, "mp3file");

But the option is not getting added in context menu. I checked in regedit as well, the key has been added successfully.

EDIT: snapshot of context menu on .mp3 enter image description here

Community
  • 1
  • 1
Hummingbird
  • 647
  • 8
  • 27
  • Does it work if you do the changes in regedit, without C++? Does it work if you reboot after changing it? – deviantfan Nov 27 '15 at 22:16
  • 1
    C++ did exactly what you told it to do: make a registry key. You may want to ask [over at superuser](http://superuser.com/) because you're likely to get better targeting on the real question of: "Why doesn't my registry key work?". – user4581301 Nov 27 '15 at 22:19
  • @deviantfan unfortunately No, it doesn't work that way either when i change manually, I tried both way through code and Manually. – Hummingbird Nov 27 '15 at 22:31
  • @deviantfan i thought of inserting registry edit, snapshots as well, but then it would be too many snapshot so i chose to ask this way. – Hummingbird Nov 27 '15 at 22:32
  • @Devansh Well, then your key/value is just wrong, as user4581301 said too. It's not a programming problem anymore, ask at Superuser. – deviantfan Nov 27 '15 at 22:34
  • well thanks, I shall try at super user. – Hummingbird Nov 27 '15 at 22:41

1 Answers1

0

I can't find anything in the linked question that looks like your approach. Computers are rather exact. If they look for HKEY_CURRENT_USER\Software\Classes\mp3file\shell\open\command, then do not expect HKEY_CURRENT_USER\Software\Classes\mp3file\shell\open_wihtNewAPp to work. Even a spelling error as small as "wiht" part is already too much, let alone the entire _wihtNewAPp part.

MSalters
  • 173,980
  • 10
  • 155
  • 350