Click here to Skip to main content
13,597,148 members
Click here to Skip to main content
Add your own
alternative version


122 bookmarked
Posted 18 Jan 2007
Licenced BSD

Creating Windows Live Messenger Add-ins

, 21 Jun 2007
Rate this:
Please Sign up or sign in to vote.
An article on creating MSN 8 plug-ins

Sample image


We all know good old MSN and if you are a bit like me, you just love the games like tic-tac-toe and poker. Well, there are many articles that show you how to create new games -- one of them is here -- and there are many articles that show you how to extend your own application (hehehehe MINE ALL MINE !!!!!!!! HAHAHA ;-), but did you know that you can create a plug-in for it, as well? Well, you do now :-).

The reason why most people don't know about this nice feature is because it isn't enabled by default and is intended to get some nice feedback from you: the DEVELOPERS. Now let's get started with that programming!


To really understand this article, you only need to know a few things:

  • How to download MSN Messenger
  • How to use MSN Messenger
  • And how to fool around (Nah, that last one isn't really a requirement)

Getting started

If you want to begin programming your own new feature into MSN, you are going to try and test the plug-in. This will not work. If you remember what I said a few lines back, "It isn't enabled by default." To enable the feature, you must create or adapt a key in your registry: HKEY_CURRENT_USER\SOFTWARE\Microsoft\MSNMessenger\AddInFeatureEnabled must be set to 1. To turn it off, you must delete it or change its value to 0. If you are lazy and don't want to look for the key, just start up LiveMessengerRegistryAdapter.exe. It is a small program that can change the value of the key.

Now if you go and start up your MSN, you should see a new tab in your options dialog: Add-ins. This will be our main entrance into the world of pluggies (I wanted to say fairytales, but it sounded childish). This menu is used to load plug-ins, but it does not activate them. To activate a plug-in you just need to read on.

You are now ready to take on the real challenge: finding something that people can use in their MSN Messenger. I failed in that task; all you will see here are things nobody wants and no one asks for...

Create a Class Library and import a reference to the following library: C:\Program Files\MSN Messenger\MessengerClient.dll. Then create a class with the name of your add-in. Now before we go any further, there is a requirement for an add-in. That is, the assembly name must have a name in the Namespace.ClassName format. This must be the full name of the class that implements the IMessengerAddIn interface. In VS 2005, this is also the project name. This is all because the programmers of the MessengerClient were too lazy to do reflection on the DLL. Instead, they used the DLL name to determine which class inside the assembly to instantiate.

If the name does not match the class name that uses the IMessengerAddIn interface, then you will get a large MessageBox with the message that tells you that it failed to load in the class. This is the tricky part because the hard part is over from the minute you can load the library in your Live Messenger. So, I recommend that you first implement the interface and then test the compiled DLL in your client.

The only real bugger in this feature is that you have to shut down MSN Messenger each and every time you want to rebuild the application.

Using the code

As always, most of my explaining is located inside the code files. However, I will show you the best parts of my add-in. I love this part, as you scan all incoming messages for "dirty" words and then react to the dirty words. It would be easy for you to use a database that is on the other side of the planet and insert all the words in the database...

void Client_IncomingTextMessage(object sender, IncomingTextMessageEventArgs e)
    // Checkout the incoming textmessage...
    if (e.TextMessage.Contains("porn") ||
    e.TextMessage.Contains("pron") ||
        String caption = "WARNING";

        StringBuilder textMessage = new StringBuilder();
        textMessage.Append("MESSAGE TO ALL PEOPLE AROUND:\n");
        textMessage.Append(" is sending PORN to this nice little nerd!!!");

        // Alert every person that is standing in the neighbourhood.
        System.Windows.Forms.MessageBox.Show(textMessage.ToString(), caption,

        // And make this a noisy message :-)
        for (int i = 0; i < 10; i++)

        // And finally warn the other user not to 
        // send porn to this little nerd.
        // Just show him a red text message :-).
        // You could also send him a normal text message using 
        // "Client.SendTextMessage(text, userTo);"
        Client.SendActionMessage(Client.LocalUser.FriendlyName + 
            " is not allowed to receive porn.", e.UserFrom);

Well, I really should encourage you to view the code file. It is more comment than code, so don't worry... And I hope this article will get you all started programming features for MSN Live.


I just went crazy when my plug-in did not work while loaded. The plug-in will only work when you actually activate it manually. This is, of course, after you load the plug-in into the Add-in tab. See the first picture for the Add-in tab.

Sample image

Points of interest

I never knew that you could bug people with a plug-in on MSN. And the people don't know that they can shut this add-in feature off... :-) All that because I don't tell them. Muahahaha, I AM SO EVIL.


  • 18 January, 2007 -- Original version posted
  • 6 April, 2007 -- First update
  • 21 June, 2007 -- Article edited and moved to the main article base


This article, along with any associated source code and files, is licensed under The BSD License


About the Author

No Biography provided

You may also be interested in...


Comments and Discussions

Generalbad word filter to protect my kids. with [***********] 's Pin
ZUPERKOOL7-Feb-10 7:30
memberZUPERKOOL7-Feb-10 7:30 
GeneralRe: bad word filter to protect my kids. with [***********] 's Pin
Filip van der Meeren7-Feb-10 10:34
memberFilip van der Meeren7-Feb-10 10:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web03-2016 | 2.8.180621.3 | Last Updated 21 Jun 2007
Article Copyright 2007 by Filip van der Meeren
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid