Using C#/.Net, how can I determine which program is registered as the default email client? I don't need to launch the app, I just want to know what it is.
+8
A:
You can look in the registry on the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail
Sani Huttunen
2009-07-13 14:26:44
+1 only a bit faster that me...
Jonathan
2009-07-13 14:28:52
+3
A:
You can read this key of the registry
HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail
Jonathan
2009-07-13 14:27:56
+1
A:
I think you should be able to find that info in the registry at HKLM\Software\Clients\Mail
.
Look for the default string value.
bruno conde
2009-07-13 14:28:42
+3
A:
Use the Registry class to search the registry. This console app demonstrates the principle.
using System;
using Microsoft.Win32;
namespace RegistryTestApp
{
class Program
{
static void Main(string[] args)
{
object mailClient = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail", "", "none");
Console.WriteLine(mailClient.ToString());
}
}
}
Richie Cotton
2009-07-13 14:43:21