These articles below sit here for prosperity purposes only, commenting on them has been disabled. I should warn you that most of these posts were salvaged from a dodgey import I did from a Wordpress install on mysql db to a Cuyahoga install on a MSSQL 08 database.

How to write MSN Add-Ins

First off, you need to enable Add-Ins for MSN in your registry, this can be accomplished by running regedit, and browsing to: HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger There you will need to create a DWORD named AddInFeatureEnabled and set it's value to 1. Ok once thats done, fire up your favorite .Net IDE and start a new Class Library. Add Program Files\MSN Messenger\MessengerClient.dll to your references. For the sake of not using fully qualified type names add the following using statement:

using Microsoft.Messenger
Your class will need to implement the IMessengerAddin interface, which offers the initialize method that will need to be implemented like so:
public void Initialize(MessengerClient messenger){}
I could expand on all the exposed events, methods and properties made available to us, but thats your job I'm afraid, also I'm lazy, however to give you an idea, here is some code for an Auto Reply Add-In.
using System; using System.Collections.Generic; using System.Text; using Microsoft.Messenger; namespace MSN { public class AutoReply:IMessengerAddIn { private MessengerClient client = null; public void Initialize(MessengerClient messenger) { client = messenger; client.AddInProperties.Creator = "your name"; client.AddInProperties.Description = "add-in description"; client.AddInProperties.FriendlyName = "add-in name"; client.AddInProperties.PersonalStatusMessage = "add-in turned on"; client.AddInProperties.Status = UserStatus.Online; client.IncomingTextMessage+=new ventHandler (IncomingMessage); } public void IncomingMessage(Object Sender, IncomingTextMessageEventArgs e) { User user = e.UserFrom; Client.SendTextMessage("I am away at the moment please try again later ", user); } } }
Once compiled your library will be named like so: namespace.dll you will need to change that to namespace.classname.dll. Then just fire up MSN, add the Add-In under the Add-Ins menu option in the tools dialog. And thats that, here is an Add-In I wrote that updates your personal message every 6 seconds with how long you've been signed in for.Useful, I know.

Category Development_old


Back