Shoutbox

Enable or Disable MenuItems in runtime - 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: Enable or Disable MenuItems in runtime (/showthread.php?tid=74603)

Enable or Disable MenuItems in runtime by Lobo on 05-22-2007 at 01:57 PM

Hi!

How can I enable or disable menuitems in runtime?
Thanks!


RE: Enable or Disable MenuItems in runtime by Volv on 05-22-2007 at 02:04 PM

Check out the Messenger Plus! Scripting Documentation - Specifically this page: Events Reference > Messenger Plus! Events > OnGetScriptMenu.
What you need is to place your menus in the OnGetScriptMenu event rather than the ScriptInfo.xml file. This event is called whenever one of your script's menus is accessed and hence you can change it during runtime by adding the appropriate code in this event.

Also, checkout my post at http://shoutbox.menthix.net/showthread.php?tid=56747&pid=636090#pid636090 for a more user-friendly way of generating your menus at runtime.


RE: Enable or Disable MenuItems in runtime by Lobo on 05-22-2007 at 02:27 PM

Awnsome!!! Thanks :)