programs - windows register protocol handler
Register Windows program with the mailto protocol programmatically (2)
How do I make it so
links will be registered with my program?
How would I then handle that event in my program?
Most of the solutions I found from a quick Google search are how to do this manually, but I need to do this automatically for users of my program if they click a button, such as "set as default email client".
Removed reference to Delphi, because the answer is independent of your language.
From what I've seen, there are a few registry keys that set the default mail client. One of them being:
Mail program command-line
I'm not familar with
, but I'm sure there are some
registry editing libraries
in there that you could use to modify this value.
Some places list more than this key , others just this key, so you may need to test a little bit to find the proper one(s).
Here is the official Microsoft Solution to programmatically change the default mail client. It's Visual Basic, but I hope the concept is clear from this: