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...