Hello There, Guest! (LoginRegister)

Skinning Documentation

Introduction to Scripting
Getting Started
What's a Messenger Plus! Script?
Scripting Environment
Your First Script
Working with Scripts
From Plugins to Scripts
Packaging your Script
Windows for your Script
Testing your Windows
Objects Reference
Debug Object
Description
Functions
Trace
ClearDebuggingWindow
Properties
DebuggingWindowVisible
Messenger Object
Description
Functions
AutoSignin
Signout
OpenChat
Properties
Version
VersionBuild
ContactListWndHandle
CurrentChats
ReceiveFileDir
MyContacts
MyEmail
MyUserId
MyStatus
MyName
MyPersonalMessage
MyCurrentMedia
MyDisplayPicture
CustomEmoticons
MsgPlus Object
Description
Functions
DisplayToast
DisplayToastContact
CreateWnd
CreateChildWnd
AddTimer
CancelTimer
PlaySound
LockMessenger
LogEvent
RemoveFormatCodes
DownloadFile
UploadFileFTP
LoadScriptFile
ExtractFromZIP
Properties
Version
VersionBuild
ScriptRegPath
ScriptFilesPath
MessengerIsLocked
UILangCode
ChatWnds Object
Description
Functions
Iterator
Properties
Count
ChatWnd Object
Description
Functions
SendMessage
SendFile
AddContact
DisplayInfoMessage
ResetInfoMessage
EditText_GetCurSelStart
EditText_GetCurSelEnd
EditText_SetCurSel
EditText_ReplaceSel
HistoryText_GetCurSelStart
HistoryText_GetCurSelEnd
HistoryText_GetTextRange
Properties
Handle
Contacts
EditText
EditChangeAllowed
ChatLogEnabled
OverrideFmtEnabled
IsMobileChat
Contacts Object
Description
Functions
Iterator
GetContact
Properties
Count
Contact Object
Description
Properties
Email
Network
Status
Name
PersonalMessage
CurrentMedia
Blocked
DisplayPicture
IsFloating
Emoticons Object
Description
Functions
Iterator
GetEmoticon
Properties
Count
Emoticon Object
Description
Properties
Shortcut
Name
PictureFile
PlusWnd Object
Description
Functions
Close
RegisterMessageNotification
GetControlHandle
SendControlMessage
GetControlText
SetControlText
GetElementPos
Button and Checkmark Controls
Button_IsChecked
Button_SetCheckState
Button_SetElementText
ComboBox Controls
Combo_AddItem
Combo_RemoveItem
Combo_GetCurSel
Combo_SetCurSel
Combo_GetItemData
Combo_GetCount
ListBox Controls
LstBox_AddItem
LstBox_GetItemText
LstBox_RemoveItem
LstBox_GetCurSel
LstBox_SetCurSel
LstBox_GetItemData
LstBox_GetCount
ListView Controls
LstView_AddItem
LstView_SetItemText
LstView_GetItemText
LstView_RemoveItem
LstView_GetItemData
LstView_GetCount
LstView_GetSelectedState
LstView_SetSelectedState
LstView_GetCheckedState
LstView_SetCheckedState
LstView_SetItemIcon
Edit and RichEdit Controls
EditBox_SetCurSel
EditBox_ReplaceSel
EditBox_GetCurSelStart
EditBox_GetCurSelEnd
RichEdit_GetTextRange
RichEdit_SetCharFormat
Browser Controls
Browser_GetInterface
Image Elements
ImageElmt_SetImageFile
Properties
Handle
Visible
WindowId
Interop Object
Description
Functions
Call
Call2
FreeDll
GetLastError
Allocate
GetCallbackPtr
DataBloc Object
Description
Functions
GetAt
SetAt
ReadString
WriteString
ReadBSTR
WriteBSTR
ReadWORD
WriteWORD
ReadDWORD
WriteDWORD
ReadInterfacePtr
WriteInterfacePtr
Properties
Size
DataPtr
Events Reference
Messenger Events
OnEvent_Signin
OnEvent_SigninReady
OnEvent_Signout
OnEvent_MyStatusChange
OnEvent_MyNameChange
OnEvent_MyPsmChange
OnEvent_MyMediaChange
OnEvent_ContactSignin
OnEvent_ContactSignout
OnEvent_ContactStatusChange
OnEvent_ContactNameChange
OnEvent_ContactPsmChange
OnEvent_ContactMediaChange
OnEvent_ContactBlocked
OnEvent_ContactUnblocked
OnEvent_ContactListWndCreated
OnEvent_ContactListWndDestroyed
OnEvent_ChatWndCreated
OnEvent_ChatWndDestroyed
OnEvent_ChatWndContactAdded
OnEvent_ChatWndContactRemoved
OnEvent_ChatWndReceiveMessage
OnEvent_ChatWndSendMessage
OnEvent_ChatWndEditKeydown
Messenger Plus! Events
OnEvent_Initialize
OnEvent_Uninitialize
OnEvent_MessengerLocked
OnEvent_MessengerUnlocked
OnEvent_Timer
OnEvent_MenuClicked
OnEvent_EnterPersonalizedStatus
OnEvent_LeavePersonalizedStatus
OnEvent_DownloadFileComplete
OnEvent_UploadFileComplete
OnGetScriptMenu
OnGetScriptCommands
Events Templates
ScriptsCommandTemplate
ToastCallbackTemplate
Interface Windows Events
OnWindowidEvent_Cancel
OnWindowidEvent_Destroyed
OnWindowidEvent_MessageNotification
OnWindowidEvent_CtrlClicked
OnWindowidEvent_ComboSelChanged
OnWindowidEvent_EditTextChanged
OnWindowidEvent_LstBoxSelChanged
OnWindowidEvent_LstBoxDblClicked
OnWindowidEvent_LstViewClicked
OnWindowidEvent_LstViewRClicked
OnWindowidEvent_LstViewDblClicked
OnWindowidEvent_LstViewSelStateChanged
XML Schemas Reference
ScriptInfo File
Information
Examples
Schema Documentation
Interface Windows
Information
Examples
Schema Documentation

From Plugins to Scripts

This document is intended to be read by developers familiar with the old plugin system of Messenger Plus! 3.

The old plugins system previously offered by Messenger Plus! has been deprecated and is no longer supported by Messenger Plus! Live. Developers of such plugins are faced with two options when upgrading their old plugins for Messenger Plus Live!:

  • Create a script proxy that will call their old plugin DLL.
  • Recreate their features from scratch in the new Messenger Plus! Live scripting system.

If you're in a hurry, solution 1 may sound appealing so you may want to know that this solution comes with a couple of limitations. First, the scripting API does not give direct access to the old Messenger COM object (from the days of Windows Messenger 4) which means that if your plugin was using the "iMessengerObj" or "oMessenger" parameter of Initialize, it will need to be modified to work in the new system. Also, if your plugin was created with the C/C++ interface (as opposed to the VB interface), you will need to use a DataBloc object to create the structure parameters for functions like ParseCommand.

Recreating your features directly in the scripting system may take longer but will bring several new advantages. The main obvious one is the rich API offered by the scripting system compared to the one that was available for plugins. Your script will be able to do much more and with less code. You'll also be able to take advantage of the interface windows feature of Messenger Plus! Live and create windows for your script that will completely blend in Messenger. Nevertheless, if you want to directly load your old plugin DLL, here is how to do it:

//Load a C plugin DLL
function LoadPlugin_Dll(DllPath)
{
  if(Interop.Call(DllPath, "Initialize", 8, "", 0) == 1)
                Debug.Trace("The C plugin has been initialized");
}

//Load a VB ActiveX object
function LoadPlugin_VB(ProgId)
{
  var PluginObj = new ActiveXObject(ProgId);
  if(PluginObj)
        {
          if(PluginObj.Initialize(8, "", undefined) == true)
                        Debug.Trace("The VB plugin has been initialized");
        }
}

Here is an upgrade listing that will help you make the switch from the old system to the new one.

C/C++ Developers:

Plugins Interface Scripting System Additional Information
Initialize OnEvent_Initialize
OnEvent_Signin
You should send 8 for the nVersion parameter.
sUserEmail is an empty string when called from OnEvent_Initialize and Email when called from OnEvent_Signin.
iMessengerObj must be null (send 0).
Uninitialize OnEvent_Uninitialize
OnEvent_Signout
None.
Configure OnGetScriptMenu
OnEvent_MenuClicked
Scripts create their own menus with OnGetScriptMenu or the ScriptInfo file. You can create your own "Configure" menu from there.
PublishInfo OnGetScriptCommands Scripts return the list of commands they support in OnGetScriptCommands or specify them in the ScriptInfo file. This information is used for informational purposes only in windows such as the Command Helper. It is the responsibility of scripts to parse every message sent for eventual commands or tags to replace.
ParseCommand OnEvent_ChatWndSendMessage Messenger Plus! Live does not search for specific script commands in messages sent by the user. Instead, every message is sent to scripts so that they can do their own analysis of the message. This removes the need for all your commands to start with "/x" and gives you much more flexibility for the output.
pParam->iConversationWnd must be null (send 0).
pParam->sContactName should be an empty string.
ParseTag OnEvent_ChatWndSendMessage Messenger Plus! Live does not search for specific script tags in messages sent by the user. Instead, every message is sent to scripts so that they can do their own analysis of the message. This removes the need for all your tags to start with "!X" and gives you much more flexibility for the output.
pParam->iConversationWnd must be null (send 0).
pParam->sContactName should be an empty string.
ReceiveNotify OnEvent_ChatWndReceiveMessage Messenger Plus! Live does not search for specific markers in messages that are received. Instead, every message is sent to scripts so that they can do their own analysis of the message.
pParam->iConversationWnd must be null (send 0).
pParam->sContactName is set to the Origin parameter of the event.
DisplayToast MsgPlus.DisplayToast
MsgPlus.DisplayToastContact
None.
SetNewName Messenger.MyName None.
AddEventEntry MsgPlus.LogEvent None.

Additional note: when calling your old C/C++ plugin, make sure to convert your strings to ANSI if your plugin was not using the Unicode handlers. In JScript, every string is Unicode by default.

Visual Basic Developers:

Plugins Interface Scripting System Additional Information
Initialize OnEvent_Initialize
OnEvent_Signin
You should send 8 for the nVersion parameter.
sUserEmail is an empty string when called from OnEvent_Initialize and Email when called from OnEvent_Signin.
oMessenger must be undefined.
Uninitialize OnEvent_Uninitialize
OnEvent_Signout
None.
Configure OnGetScriptMenu
OnEvent_MenuClicked
Scripts create their own menus with OnGetScriptMenu or the ScriptInfo file. You can create your own "Configure" menu from there.
GetPublishInfo
GetPublishCommandInfo
OnGetScriptCommands Scripts return the list of commands they support in OnGetScriptCommands or specify them in the ScriptInfo file. This information is used for informational purposes only in windows such as the Command Helper. It is the responsibility of scripts to parse every message sent for eventual commands or tags to replace.
GetPublishTagInfo None Scripts should create entries in their own menu.
ParseCommand OnEvent_ChatWndSendMessage Messenger Plus! Live does not search for specific script commands in messages sent by the user. Instead, every message is sent to scripts so that they can do their own analysis of the message. This removes the need for all your commands to start with "/x" and gives you much more flexibility for the output.
oConversationWnd must be undefined.
ParseTag OnEvent_ChatWndSendMessage Messenger Plus! Live does not search for specific script tags in messages sent by the user. Instead, every message is sent to scripts so that they can do their own analysis of the message. This removes the need for all your tags to start with "!X" and gives you much more flexibility for the output.
oConversationWnd must be undefined.
ReceiveNotify OnEvent_ChatWndReceiveMessage Messenger Plus! Live does not search for specific markers in messages that are received. Instead, every message is sent to scripts so that they can do their own analysis of the message.
oConversationWnd must be undefined.
sContactName is set to the Origin parameter of the event.
DisplayToast MsgPlus.DisplayToast
MsgPlus.DisplayToastContact
None.
SetNewName Messenger.MyName None.
AddEventEntry MsgPlus.LogEvent None.

See Also

Interop Object, DataBloc Object, JScript's ActiveXObject.