<p>How do I make it so <code>mailto:</code> links will be registered with my program?</p>
<p>How would I then handle that event in my program?</p>
<p>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 &quot;set as default email client&quot;.</p>
<p>#Edit:
Removed reference to Delphi, because the answer is independent of your language.</p>

[{'answer_id': 233, 'author': 'Dillie-O', 'author_id': 71, 'author_profile': 'https://Stackoverflow.com/users/71', 'pm_score': 4, 'selected': False, 'text': "<p>From what I've seen, there are a few registry keys that set the default mail client. One of them is:</p>\n<p>System Key: <code>[HKEY_CLASSES_ROOT\\mailto\\shell\\open\\command]</code></p>\n<p>Value Name: <code>(Default)</code></p>\n<p>Data Type: <code>REG_SZ</code> (String Value)</p>\n<p>Value Data: <code>Mail program command-line</code>.</p>\n<p>I'm not familiar  with <code>Delphi 7</code>, but I'm sure there are some <em>registry editing libraries</em> there that you could use to modify this value.</p>\n<p>Some places list more than this <em>key</em>, others just this key, so you may need to test a little bit to find the proper one(s).</p>\n"}, {'answer_id': 1812, 'author': 'Liron Yahdav', 'author_id': 62, 'author_profile': 'https://Stackoverflow.com/users/62', 'pm_score': 5, 'selected': True, 'text': '<p><em>@Dillie-O: Your answer put me in the right direction (I should have expected it to just be a registry change) and I got this working. But I\'m going to mark this as the answer because I\'m going to put some additional information that I found while working on this.</em></p>\n<p>The solution to this question really doesn\'t depend on what programming language you\'re using, as long as there\'s some way to modify Windows registry settings.</p>\n<p>Finally, here\'s the answer:</p>\n<ul>\n<li>To associate a program with the mailto protocol for <strong>all users</strong> on a computer, change the HKEY_CLASSES_ROOT\\mailto\\shell\\open\\command Default value to:<br />\n&quot;<em>Your program\'s executable</em>&quot; &quot;%1&quot;</li>\n<li>To <a href="http://windowsxp.mvps.org/permail.htm" rel="nofollow noreferrer">associate a program with the mailto protocol for the <strong>current user</strong></a>, change the HKEY_CURRENT_USER\\Software\\Classes\\mailto\\shell\\open\\command Default value to:<br />\n&quot;<em>Your program\'s executable</em>&quot; &quot;%1&quot;</li>\n</ul>\n<p>The %1 will be replaced with the entire mailto URL. For example, given the link:</p>\n<pre><code>&lt;a href=&quot;mailto:user@example.com&quot;&gt;Email me&lt;/a&gt;\n</code></pre>\n<p>The following will be executed:<br />\n&quot;<em>Your program\'s executable</em>&quot; &quot;mailto:user@example.com&quot;</p>\n<p>Update (via comment by shellscape):<br />\nAs of Windows 8, this method no longer works as expected. Win8 enforces the following key: HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associati\u200c\u200bons\\URLAssociations\\\u200c\u200bMAILTO\\UserChoice for which the ProgID of the selected app is hashed and can\'t be forged. It\'s a royal PITA.</p>\n'}]
['https://Stackoverflow.com/questions/231', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/62/']