Shoutbox

[Help] TrackPopupMenu - 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] TrackPopupMenu (/showthread.php?tid=77836)

[Help] TrackPopupMenu by Hanumanji on 09-28-2007 at 09:27 AM

Hi!.... I have this problem with TrackPopupMenu... When I try to popup a menu it returns an error message:

code:
Bad calling convention detected for "TrackPopupMenu" in "user32". The function must be declared with __stdcall and called with the appropriate number of parameter.

What could be wrong? Here is the code i've used.... and yes, the constants are defined.

code:
hMenu = Interop.Call('user32', 'CreatePopupMenu');
Interop.Call('user32', 'AppendMenuW', hMenu, MF_STRING, 301, 'Test');
var POINTAPI = Interop.Allocate( 8);
Interop.Call('user32', 'GetCursorPos', POINTAPI);   
ret = Interop.Call('user32','TrackPopupMenu', hMenu, 0, POINTAPI.ReadDWORD(0), POINTAPI.ReadDWORD(4), Wnd.Handle, 0);


Thanks!
RE: [Help] TrackPopupMenu by Hanumanji on 09-28-2007 at 09:36 AM

Nevermind, I missed one parameter :)

code:
ret = Interop.Call('user32','TrackPopupMenu', hMenu, 0, POINTAPI.ReadDWORD(0), POINTAPI.ReadDWORD(4), 0, Wnd.Handle, 0);

Sorry!