Shoutbox

[Help] Patchou we cant get the Handle of Menu? - 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: [Help] Patchou we cant get the Handle of Menu? (/showthread.php?tid=75887)

[Help] Patchou we cant get the Handle of Menu? by Flash on 07-05-2007 at 04:35 PM

i can destroy or close a Menu open from MenuButton control with a cmd like this

code:
i tyed
var hand = PlusWnd1.GetControlHandle('MnuCED')
var wh = PlusWnd1.handle
var i = Interop.Call("User32","GetMenu",wh)
var ii = Interop.Call("User32","IsMenu",hand)
var iii = Interop.Call("User32","DestroyMenu",hand)
Debug.Trace('Menu test: ' +wh+' ' +hand+' ' +i+' ' +ii+ ' '+iii)

Menu test: 7406936 0 0 0 0

i see i canT get the handle for the menu with getcontrolhandle
that not work, but a cmd exist for close the menu?
code:
<Control xsi:type="MenuButtonControl" Id="BtnAdd_Edit">
                <Position Top="92" Left="9" Width="70" Height="14"/>
                <Attributes>
                    <AlwaysDisplayBorder>true</AlwaysDisplayBorder>
                </Attributes>
                <TextColor><GlobalColor>black</GlobalColor></TextColor>
                <Menu Id="MnuCED" VPos="Bottom" HPos="CenterLeft">

RE: [Help] Patchou we cant get the Handle of Menu? by deAd on 07-05-2007 at 05:51 PM

If you are just trying to close a menu which is open, simulate a click on the button which opened it (this will open it if it is closed) or simulate a click on an empty part of the dialog (make sure it's empty so you don't end up clicking another control by accident).

If you really need the handle, you can try here for a way to get a menu handle for the latest version of Plus!. Please read the post carefully so you understand the limitations and dangers of using this.


RE: [Help] Patchou we cant get the Handle of Menu? by Flash on 07-05-2007 at 06:47 PM

Damn that code work fine but now i cant only close lol
if a destroymenu that DESTROY haha and the menu not reappear after :|
so before that i tryed SetFocus on a editbox but i think i need a click to


RE: [Help] Patchou we cant get the Handle of Menu? by deAd on 07-05-2007 at 06:54 PM

Don't use DestroyMenu on the handle the other code produces, because the handle is reused.


RE: [Help] Patchou we cant get the Handle of Menu? by Flash on 07-05-2007 at 07:52 PM

so i use other button now lol
hide button menu show button normal :| too easy code

thx dead very much for your help ;)