OK, it might be a problem with my system but I’m having a very difficult time getting Windows 7 to recognize my custom exe as the default handler of the mailto protocol.
First, I’ve seen this:
Register Windows program with the mailto protocol programmatically
Next, I’ve seen these:
- How to Register an Internet Browser or Email Client With the Windows Start Menu
- Registering an Application to a URL Protocol
I’ve added what seemed the appropriate registry entries but I still get Windows Live Mail coming up every time I click a mailto link (whether in a browser or via the Run window). I’ve set the registry entries for all users and for the current user, still it doesn’t work.
When I go to the ‘default programs’ app and scroll down to the mailto protocol, I only see Outlook and Windows Live Mail listed. My custom app doesn’t even appear.
I figure that it’s either something special with Windows 7 or it’s something with my computer.
My custom app is a WinForms .Net app but I don’t think that matters.
Any ideas are greatly welcome.
The way described in the answer which you referenced in your question seems correct way for Windows 7 as for other operation systems.
I suppose that you use 64-bit version of Windows 7 and your program is 32-bit application. So if your application write in the
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\mailto\shell\open\commandkey it modifies only the keyHKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\mailto\shell\open\commandused for 32-bit applications. You can read more about registry virtualisation here and here.If it’s your case you can call directly native Win32 API RegOpenKeyEx with the KEY_WOW64_64KEY flag which will be ignored on 32-bit operation system.