Shoutbox

WantReturn - 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: WantReturn (/showthread.php?tid=90690)

WantReturn by toto69230 on 05-18-2009 at 08:18 PM

Hello!!!!
then, I have a problem, I want that when I press the Entrer key EditControl in my window, that launches a function, does not import which

I know that it is necessary to write
<Attributes>
       <WantReturn>true</WantReturn>
</Attributes>
on my EditControl, but then?!
lol
Thank you for your answers…


RE: WantReturn by matty on 05-19-2009 at 01:00 PM

<WantReturn> simply tells the edit control to allow you to press Enter to create a new line. It does not do what you are looking for.

You need to, in this case, register the WM_KEYDOWN and check to see which key is pressed. If it is the enter key then process it.


RE: RE: WantReturn by toto69230 on 05-19-2009 at 06:58 PM

Ok thank you for the information:)
but I understand very badly English moreover I begin in the Javascript you can write the code please


RE: WantReturn by SmokingCookie on 05-24-2009 at 08:37 AM

There is a hot key class. Check out the "Video Converter Plus!" link in my signature; it points to a script that uses the particular class ("Hotkey.js"). Using that class, you can specify what should be done to the window:

JScript code:
// The [ENTER] key
VK_RETURN        = 0x0D;

// Create the window
var WndTest = MsgPlus.CreateWnd("Windows.xml" /* can be any XML file */,"WndTest" /* The window ID you want to create */)

// Create the hot key
// Note the last parameter
new Hotkey(VK_RETURN,0,MyWindow.Handle,function() {
    <do_what_you_want_here>
} /* This is how you specify an anonymous function.
Allows you to specify a function without using a variable */ );

//Register it
Hotkey_RegisterNotification(WndTest);

// Listen to the hot key notification
function OnWndTestEvent_MessageNotification(PlusWnd,Message,lParam,wParam) {
    // Call Hotkey_HandleEvent(); with the same parameters as the MessageNotification function.
    Hotkey_HandleEvent.apply(this,arguments);
}

// Make sure the hot key gets destroyed
function OnWndTestEvent_Destroyed(PlusWnd,ExitCode) {
    Hotkey_WindowDestroyed(PlusWnd);
}

This should work.

Side-note: credits go to Matti
RE: WantReturn by toto69230 on 05-24-2009 at 01:50 PM

THANKS YOU VERY VERY MUCH !!!!!!!!!!!!


RE: WantReturn by matty on 05-24-2009 at 03:54 PM

Not the best way of doing it but it would suffice... what happens when you use Enter in another window?


RE: RE: WantReturn by SmokingCookie on 05-24-2009 at 04:58 PM

Nothing. The class unregisters hot keys when a window loses focus.