Click here to Skip to main content
Click here to Skip to main content

Windows Messenger Private API

, 2 Oct 2005
Rate this:
Please Sign up or sign in to vote.
Explains how to use Windows Messenger's private API, and provides a wrapper class for the challenge-response process

Introduction

Windows Messenger provides API for accessing some of its internal objects, e.g. enumerate the logged-on user's contact list. This API is exposed as a COM object, through the Messenger API Type Library (msmsgs.exe).

A major drawback of this API is that it lacks some basic functionality. For example, it is impossible to programmatically add a given user to the contact list without the need for user interaction (we can only launch the "Add a contact..." dialog box).

This article suggests a solution to this unfortunate issue, through the use of Windows Messenger Private APIs.

Windows Messenger's Private API

Windows Messenger has another set of APIs, which is probably intended for internal MS use only. This API is also exposed as a COM object, through the Messenger Private Type Library (msmsgs.exe). Among other things, the API provides the ability to programmatically add a user to the contact list, with no user interaction whatsoever.

However, attempting to use this API reveals that each and every method throws an exception, claiming that the object wasn't "unlocked". MSDN documentation explains that applications need to authenticate themselves in a challenge-response process, which requires the use of an ID / KEY pair. The latter might have been issued by MS in the past, but no more.

The attached C# source code package demonstrates how the private API can be unlocked.

What's Inside?

The source code package consists of a single VS2003 project (console application) and two C# classes:

  • MessengerUnlocker unlocks a given MessengerPriv object, by performing the challenge-response process. This is the nuts-and-bolts of this article.
  • MessengerUnlockerDemo is nothing but a Main method that creates, unlocks and uses a MessengerPriv object. To prove that the latter is indeed unlocked, a hard-coded user is added to the running user's contact list.

Source code is documented in a standard C# style. Here and there, the source links to external Internet sites for further explanations regarding the challenge-response process.

Troubleshooting

Make sure you have Windows Messenger installed, running and signed-in before running the demo.

Before running the demo a second time, remove the newly added user from the contact list. Attempting to add an already-added contact causes an exception to be thrown.

Disclaimer

This code heavily relies on private and unsupported APIs, which are subject to change at any given moment (assessing the likeliness of the API actually changing in the future is left for the reader). This article is the product of my curiosity and free time. If you base your production code on this, you are mad.

The code was tested against Windows Messenger 4.7.3001, but might as well work perfectly against other versions of Windows Messenger (4.6 in particular). It would probably not work against MSN Messenger of any version.

Thanks

Special thanks goes to http://www.hypothetic.org/docs/msn/, for their great documentation of the Messenger Protocol. These wonderful guys provided me with the last missing piece of the puzzle - a valid ApplicationId / ApplicationKey pair Smile | :)

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

DL!
Web Developer
Israel Israel
No Biography provided

Comments and Discussions

 
Generalbad word filter to protect my kids. with [***********] 's PinmemberZUPERKOOL7-Feb-10 10:20 
Generalmessages events Pinmembernadavg10-Jul-07 12:22 
GeneralBad Locking PinmemberThe Limey22-Jan-06 10:14 
GeneralRecording Transmited Voice Pinmembertriplebit6-Jan-06 5:55 
GeneralUnable to download PinmemberLowest of the Low24-Oct-05 3:11 
GeneralCodeProject issues PinmemberDL!25-Oct-05 3:08 
QuestionRe: CodeProject issues Pinmemberyangzw_cn29-May-06 14:43 
AnswerRe: CodeProject issues PinmemberDL!29-May-06 21:04 

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

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

| Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 2 Oct 2005
Article Copyright 2005 by DL!
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid