Jump to content
  • Advertisement
Sign in to follow this  
Cibressus

[.net] Getting Messages From MSN Messenger

This topic is 4840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone know of a way to have a C# application interact with MSN messenger? Specificly, Finding when someone logs in and logs out? I have read that you can find out what songs ITunes/WMP is playing, is thier something simmilar for msn messenger?

Share this post


Link to post
Share on other sites
Advertisement
In your solution, you need to add a reference to the Messenger API type library. Then you just have to create your messenger object and subscribe to whatever events you want.

try
{
MessengerAPI.Messenger msn = new MessengerAPI.MessengerClass();
msn.OnContactStatusChange += new MessengerAPI.DMessengerEvents_OnContactStatusChangeEventHandler(this.OnContactStatusChange);
}
catch(Exception e)
{
...
}

And in your event handlers you just have to do a bit of work to get the information you'll want. Note that contact.Status isn't actually the text representation of the contact's status ('Away', 'Offline', etc.). You may have to do a bit of conversion.

private void OnContactStatusChange(object pMContact, MessengerAPI.MISTATUS mStatus)
{
MessengerAPI.IMessengerContact contact = pMContact as MessengerAPI.IMessengerContact;
Console.WriteLine(contact.FriendlyName + " is now " + contact.Status);
}

Share this post


Link to post
Share on other sites
Martee, what version of Messenger was that? It seems like 6 and 7 doesn't have the API anymore.. It seems like you have to hook windows and stuff.. Or is there a .NET way?

Share this post


Link to post
Share on other sites
I'm interested in this now! Have you tried looking for a download? It might not be installed as standard.

EDIT: I've got it - looking for documentation

EDIT: From MSN it looks like you might need to register with them and write registry keys etc...complicated :(

[Edited by - DrGUI on August 13, 2005 5:29:39 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!