Shoutbox

Call MsgPlus functions from a script - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Call MsgPlus functions from a script (/showthread.php?tid=80727)

Call MsgPlus functions from a script by mynetx on 01-05-2008 at 05:25 PM

A script uses a BrowserControl. It is thus only compatible with MPL >=4.50. How can I open the original MsgPlus Update dialog when MsgPlus.VersionBuild < 312? I'm also thinking of cases where the user set the auto-update check off in MPL prefs...

Short question: How to trigger MPL self-update from a script?

Second question: How to access other functions, like opening Plus prefs, CL clean-up window, or Plus about pane?
Regards,


RE: Call MsgPlus functions from a script by markee on 01-06-2008 at 12:26 AM

You could just make a window explaining that some features won't work until they upgrade plus to the latest version if their version number is not what you need....


RE: Call MsgPlus functions from a script by CookieRevised on 01-06-2008 at 01:15 AM

quote:
Originally posted by markee
You could just make a window explaining that some features won't work until they upgrade plus to the latest version if their version number is not what you need....
Which is indeed what every script in such a situation should do....

----

mynetx, you can only invoke functions which are listed in the Plus! menus. This is done by sending the cmdid (command id) of the wanted menu item to the main Messenger window using the PostMessageW Windows API. eg:
code:
To toggle the event viewer on/off:
    Interop.Call('User32', 'PostMessageW', Messenger.ContactListWndHandle, /* WM_COMMAND */ 0x0111, /* wParam (cmdid) */ 7401, /* lParam */ 0x0000);

// Other Plus! menu cmdids:
// 7400: About Window
// 7401: Event Viewer
// 7405: Contact List Clean-up
// 7406: Preferences
// 7407: Messenger Lock
// 7409: Contacts on Desktop
// 7410: Script Debugger
// 7412: Set Personalised Status
// 7422: Chat Log Viewer
// 7437: Sound Library
// 7452: Config Wizard
// 7454: Get New Scripts (open http://www.msgpluslive.net/scripts/browse)
// 7455: Preferences (scripts)
// 7457: Get New Skins (open http://www.msgpluslive.net/skins/)
// 7458: Preferences (skins)
// 7460: Current Skin Options
// 7461: Current Skin Website
// 7462: Toggle 'Send Personalised Status Auto-Messages'
// 7700: Invoke first personalised status
// 7701: Invoke second personalised status
// 7702: Invoke third personalised status, etc...
// 7850: Open Email Client

// Note that these cmdids might change in future versions!
* similar cmdids exist for items in the Plus! menus in a chatwindow.
* The above short example code requires that the contactlist window exists! To not depend on that, see the link below.


But don't simply trigger the Plus!-update check. This is actually not very user friendly (the user doesn't know that your script didn't work, so he/she also can simply discard the auto-update thinking he/she doesn't need it, etc).

Unless you first show the user a dialog explaining that your script needs the latest Plus! version, like markee already said.

EDIT: see also here for some important remarks and more details...