Messenger Add-in -> MSN Messenger API

I was surfing on the developer site of Windows Live . I saw the new (for me) MSN SDK. Lastly there was only activity sdk which is not real SDK.
The new Messenger Add-in SDK is included inside MSN Live messenger, althought the site says it is a seperate download.

Anyway to use it,

  • Add the key to windows registry -> HKEY_CURRENT_USER\ Software\ Microsoft\ MSNMessenger\ AddInFeatureEnabled 1

Registry Settings

  • Create a class library project

  • Add MessengerClient.dll which is located on the messenger installation directory

  • Use the interface to create the addin, the code will guide you on how to do that

    public class AutoReply : IMessengerAddIn { MessengerClient m_messenger;

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    
        void IMessengerAddIn.Initialize(MessengerClient messenger)
        {
            m_messenger = messenger;
            AddInProperties properties = m_messenger.AddInProperties;
            properties.Creator = "Can Erten";
            properties.Description = "Test";
    
            m_messenger.IncomingTextMessage += new EventHandler<incomingtextmessageeventargs> (m_messenger_IncomingTextMessage);
        }
    
        void m_messenger_IncomingTextMessage(object sender, IncomingTextMessageEventArgs e)
        {
            m_messenger.SendTextMessage("Unavailable..." + e.UserFrom.FriendlyName, e.UserFrom);
            if (m_messenger.LocalUser.Status != UserStatus.Online)
            {
                string message = m_messenger.LocalUser.PersonalStatusMessage;
                m_messenger.SendTextMessage("Unavailable..." + e.UserFrom.FriendlyName, e.UserFrom);
            }
        }
           
    }
    

As you can see it is very simple and well developed class library. Thanks to MSN team for being that clear.

  • The different part for the delivery is the assembly name. You need to change the assembly name to the namespace and class name.

  • Run Msn messenger, in the options windows, addin tab add your dll file. That’s it.

MSN Window

Finally you might want to debug the addin. To do this in visual studio, attach to msn process, make breakpoints and here we go, just debug as normally you do :) attach