What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Developers] Modifying menu button control menus

[Developers] Modifying menu button control menus
Author: Message:
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
O.P. [Developers] Modifying menu button control menus
Warning: the technique used in this example is built for Messenger Plus! Live 4.23.0.276. It may not work on other versions of Plus!. There is a safety check in the code, but if you are unsure about using this you should wait for Patchou to add functions to change the menus (hint hint :P) to the scripting API (which might never happen).

It is possible to retrieve a menu handle from a menu button control. This handle can be passed to the Win32 menu functions in order to get information or modify the menu attached to the menu button control. However, you have limitations when using this handle. If you add new menu items, they will stand out because they are not painted by Plus! unless they have the MF_OWNERDRAW flag. If you set this flag, Messenger will crash (Plus! will probably be missing some necessary information). There is a way around this but I'm not going to try and find it because it can make this hack even more version specific. I have not tested removing menus (I would guess that it would work but cause a small memory leak unless done carefully because of a structure of extra data usually used with owner drawn menus), but I would recommend you don't attempt this.

I have tested this by setting the check state and the disabled state of existing menu items. I have also added menu items (doesn't work well), but I have not removed items or tried to change their text. Enabling and disabling items will not change their appearance (they do not appear grayed).

I have attached a commented sample script that shows how to retrieve and use this menu handle.

Use carefully and enjoy :p

.plsc File Attachment: Menu Button Modifier Example.plsc (4.66 KB)
This file has been downloaded 149 time(s).

This post was edited on 06-26-2007 at 10:27 PM by deAd.
06-26-2007 10:26 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Developers] Modifying menu button control menus - by deAd on 06-26-2007 at 10:26 PM
RE: [Developers] Modifying menu button control menus - by warmth on 06-26-2007 at 10:30 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On