static String pluginsKey = "Software\\Nektra\\WLMailApi\\Plugins";
static String pluginValueName = "SimpleButtonDemo";
// Here you have to put your Namespace.YourMain.cs
static String pluginValueData = "SimpleButton.Plugin";
// To load this DLL into WLMail, it must be added to WLMailApi's key in the registry
// and WLMail's agent must be running from startup.
[ComRegisterFunctionAttribute]
public static void RegisterFunction(Type t)
{
RegistryKey key = Registry.CurrentUser.OpenSubKey(pluginsKey, true);
if (key == null)
{ // key not found
key = Registry.CurrentUser.CreateSubKey(pluginsKey);
if (key == null)
{
System.Windows.Forms.MessageBox.Show("Error registering component");
return;
}
}
key.SetValue(pluginValueName, pluginValueData);
key.Close();
}