IMessengerAddIn Interface
Creates and configures an add-in instance.
public void Initialize(MessengerClient client);
Reference to the add-in's MessengerClient instance.
· Start and configure the add-in.
· Subscribe to any events you intend to use with your add-in.
· Create a class-level variable to serve as a reference for the Messenger client.
Use the AddInProperties class to set identity data for the add-in. You should at least declare a friendly name for your add-in, which will be displayed in Messenger's user interface.
public void Initialize(MessengerClient client) {
//initialize
m_client = client;
//Add EventHandlers
...
//Change friendly name of local user
m_client.AddInProperties.FriendlyName = “My Super Cool Bot”;
}
Messenger Add-In Classes
The following Classes are supported by the Windows Live Messenger Add-Ins API:
Class |
Description |
Contains attributes of the add-in. |
|
Stores data for an IncomingTextMessage event. |
|
Stores data for an OutgoingTextMessage event. |
|
Contains information pertaining to the add-in and its associated Messenger client instance. |
|
Stores data for a StatusChanged event. |
|
Contains properties of either local or remote users. |
MessengerClient Class
Stores information pertaining to the add-in and its associated functions, and also exposes the Messenger API elements to the add-in.
public sealed class MessengerClient : System.MarshalByRefObject
MessengerClient
Reference to the MessengerClient class.
AddInProperties
AddInProperties object. Object that contains the properties of the current add-in.
LocalUser
User object. Object that contains the properties of the current local user (operating the add-in).
SavedState
String. Used to get or set the saved state, so the add-in can save data beyond a re-start of the Messenger process.
SendActionMessage
SendActionMessage method.
SendNudgeMessage
SendNudgeMessage method.
SendTextMessage
SendTextMessage method.
IncomingTextMessage
IncomingTextMessage event.
OutgoingTextMessage
OutgoingTextMessage event.
ShowOptionsDialog
ShowOptionsDialog event.
ShutDown
Shutdown event.
StatusChanged
StatusChanged event.
MessengerClient.AddInProperties Class
An AddInProperties object stores attributes of the add-in.
public class AddInProperties
AddInProperties
Reference to the AddInProperties class.
Creator
String.
Description
String. Description of the add-in, explaining what the add-in does and why a user should use it.
FriendlyName
String. Name of the add-in.
PersonalStatusMessage
String. Status message associated with the add-in.
Status
UserStatus object. Object that identifies the user's current status.
URL
URI object. Not currently used.
UserTile
Image.
MessengerClient.IncomingTextMessageEventArgs Class
An IncomingTextMessageEventArgs object stores data for an IncomingTextMessage event.
public class IncomingTextMessageEventArgs : System.EventArgs
IncomingTextMessageEventArgs
Reference to the IncomingTextMessageEventArgs class.
TextMessage
String. Text of the message.
UserFrom
User object. Object that contains the properties of the user who sent the message.
MessengerClient.OutgoingTextMessageEventArgs Class
An OutgoingTextMessageEventArgs object stores data for an OutgoingTextMessage event.
public class OutgoingTextMessageEventArgs : System.ComponentModel.CancelEventArgs
OutgoingTextMessageEventArgs
Reference to the OutgoingTextMessageEventArgs class.
TextMessage
String. Text of the message.
UserTo
User object. Object that contains the properties of the user to which a message is addressed.
MessengerClient.StatusChangedEventArgs Class
A StatusChangedEventArgs object stores data for a StatusChanged event.
public class StatusChangedEventArgs : System.EventArgs
StatusChangedEventArgs
Reference to the StatusChangedEventArgs class.
User
User object. Object that contains the properties of the user whose status has changed.
MessengerClient.User Class
The User class stores properties of either local or remote users.
public sealed class User
GetGroupNames
Method that returns a string array (a list of the groups to which the user belongs).
String
FriendlyName
String. The user's friendly name.
PersonalStatusMessage
String. Status message associated with the user.
Status
UserStatus object. Object that identifies the user's current status.
UniqueID
String. Unique identification of the user.
MessengerClient.UserStatus Enumeration
Set of constants that represent the status of the user.
public enum UserStatus
Integer Value |
Hexadecimal Value |
|
Away |
34 |
0x0022 |
BeRightBack |
14 |
0x000E |
Busy |
10 |
0x000A |
Idle |
18 |
0x0012 |
Offline |
1 |
0x0001 |
Online |
2 |
0x0002 |
OnthePhone |
50 |
0x0032 |
OuttoLunch |
66 |
0x0042 |
Unknown |
0 |
0x0000 |
Messenger Add-In Events
The following Events are supported by the Windows Live Messenger Add-Ins API:
Event |
Description |
Fires when an add-in receives a text message. |
|
Fires when a local user sends a text message to a buddy. |
|
Fires when the user accesses Messenger's Options dialog box. |
|
Fires when the Messenger client unloads the add-in. |
|
Fires when the local user's status or a buddy's status changes. |
Messenger Add-In Methods
The following Methods are supported by the Windows Live Messenger Add-Ins API:
Method |
Description |
Sends an action message to a specified user or buddy. |
|
Sends a nudge message to a specified user or buddy. |
|
Sends a text message to a specified user or buddy. |