programs - windows register protocol handler

Register Windows program with the mailto protocol programmatically (2)

How do I make it so mailto: 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:

System Key: [HKEY_CLASSES_ROOT\mailto\shell\open\command]

Value Name: (Default)

Data Type: REG_SZ (String Value)

Value Data: Mail program command-line .

I'm not familar with Delphi 7 , 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).