Introduction
This code is an Add-In for MSN Live Messenger. It updates the system time on the Messenger status after every second. It is useful in allowing the user to perform a scheduled task and notify the target user even when the source user is not available. This concept can be used widely to read Web Services, XML feeds or any database Stored Procedure to work in the same way as services.
Background
As I was looking at this MSN Addin, I found that there are many hidden functionalities which are possible as its interface MessengerClient.dll is accessible to developers. People can do virtually anything, they can even turn off the target system. But the article suggested that only interface class function is accessible. Therefore I tried to work on this interesting application as now a days, it is used everywhere for communication.
Using the Code
This class TimeUpdate
implements the Messenger Client Class. This code creates a Messenger Client Object and a Timer Object. timer
is set to trigger after every 1000 milliseconds which allows the date to be updated. You can even change other parameters (such as name, display picture, etc.) as well. MessengerClient
library is provided with MSN Live Messenger in c:/Program Files/MSN Messenger folder. To use the plugin, you need to enable the registry plugin option as used in WindowsLiveMessengerAddin article. I have pasted the steps as below.
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 earlier, "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
.
Now add the AddIn through MSN Messenger Options. Tools>Options>AddIns>Add To Messenger. After adding the DLL file, you need to turn on the Add-In by Selecting it from Personal Status Drop Down List.
Private MessengerClient client = null;
Timer timer = null;
class public void Initialize(MessengerClient messenger)
{
Client = messenger; timer = new Timer();
timer.Elapsed += new ElapsedEventHandler(Timer_Tick);
timer.Interval = 1000;
timer.Start();
Client.Shutdown += new EventHandler(Client_ShutDown);
}
public void Timer_Tick(object sender, ElapsedEventArgs args)
{
Client.AddInProperties.PersonalStatusMessage = DateTime.Now.ToString();
}
Points of Interest
It is a code just for fun and users may find it of no use to show the time in Messenger as they can see it more easily. But the idea is to provide a way to develop an intelligent Messenger which could do any task remotely. Most of the organizations block network connection while leaving the MSN port which could prove handy.
History
- 19th November, 2007 - Original version
About Talha Ekram
A code worm just trying to interfere in every aspect of programming.