How to make MSN Messenger Add-ins?

Many of you tried, searched or just thought about making a pluggin for MSN Messenger… The good news is that MSN Messenger team has made life easier for Add-ins developpers.

MessengerClient.dll API was added to the MSN Messenger folder since the version 8.0.0683.00, you can download it from here. Before starting to develop anything, you have to enable the Add-ins options with this messenger version because microsoft were trying to hide it. So here’s how you show the option:

Start / Run / “regedit”, in the registery browse to HKEY_CURRENT_USER/Software/Microsoft/MSN Messenger/ then add a DWORD (name: AddInFeatureEnabled and value: 1)…

Restart MSN Messenger, and sign in… now the Add-ins option has been enabled in the options…

The next step to do is start developping the add-in… Since I’m a java developer, C# is a good language to program with! I recommend it so bad!

Have you got your IDE? Visual Studio? Here’s SharpDevelop a free software for developing in C# and VB.Net : Click here to download.

Is it time to start coding? hell yea!!

1st of all you have to add reference to the MessengerClient.dll which is found in the new MSN Messenger folder! (Notice for java freaks: Adding reference to a .dll with .Net is like mounting a .jar file to your java project and importing it)

Let’s Start Coding…

The following code a small add-in which sends an Away message to everyone who’s trying to message you while you’re Away…

using System;
using Microsoft.Messenger;

public class EPLUGIN : IMessengerAddIn
{
private MessengerClient messenger;

public void Initialize(MessengerClient messenger)
{
this.messenger = messenger;
messenger.AddInProperties.Creator = “ElectroSoft”;
messenger.AddInProperties.Description = “Away Messenger”;
messenger.IncomingTextMessage += new EventHandler(this.OnIncomingMSG);
}

private void OnIncomingMSG(object sender, IncomingTextMessageEventArgs args)
{
if (messenger.LocalUser.Status == UserStatus.Away)
{
this.messenger.SendTextMessage(“I’m away… Leave a message… [Plugin by Elie Khoury]“, args.UserFrom);
}
}
}
As you noticed: you have to implement the IMessengerAddIn Interface… which requires you to implement the “public void Initialize(MessengerClient messenger)” function…Happy Coding… send comments guys… I’m sure there are enough things to add!

6 Responses to “How to make MSN Messenger Add-ins?”

  1. twinsen says:

    I think there’s a small error in this code, adding the eventhandler should be like this:

    .. += new EventHandler(thiOnIncomingMsg)

    Other then that, thx for the info. How do I actually add the plugin though?

  2. twinsen says:

    OOPS,

    I meant this:

    .. += new EventHandler(thiOnIncomingMsg)

  3. diogo says:

    there is something wrong in the code… :S

  4. James says:

    Does anyone know if you can make add-ins work while your status is set to online I really wish there was a way to do this, surely some addins you would want while in online mode

  5. Claton says:

    The reg hack to enable add-in does not work on 2009 .. any other options?????????

Leave a Reply