What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » WantReturn

WantReturn
Author: Message:
toto69230
Junior Member
**


Posts: 22
30 / Male / Flag
Joined: Feb 2009
O.P. WantReturn
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…
[Image: Sniper+Spirit.png]
05-18-2009 08:18 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: WantReturn
<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.
05-19-2009 01:00 PM
Profile E-Mail PM Find Quote Report
toto69230
Junior Member
**


Posts: 22
30 / Male / Flag
Joined: Feb 2009
O.P. RE: RE: WantReturn
Ok thank you for the information:)
but I understand very badly English moreover I begin in the Javascript you can write the code please
[Image: Sniper+Spirit.png]
05-19-2009 06:58 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: WantReturn
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

This post was edited on 05-24-2009 at 08:38 AM by SmokingCookie.
05-24-2009 08:37 AM
Profile PM Find Quote Report
toto69230
Junior Member
**


Posts: 22
30 / Male / Flag
Joined: Feb 2009
O.P. RE: WantReturn
THANKS YOU VERY VERY MUCH !!!!!!!!!!!!
[Image: Sniper+Spirit.png]
05-24-2009 01:50 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: WantReturn
Not the best way of doing it but it would suffice... what happens when you use Enter in another window?
05-24-2009 03:54 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: RE: WantReturn
Nothing. The class unregisters hot keys when a window loses focus.

This post was edited on 05-24-2009 at 05:00 PM by SmokingCookie.
05-24-2009 04:58 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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