What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » SendMessage doens't do anything

SendMessage doens't do anything
Author: Message:
foaly
Senior Member
****

Avatar

Posts: 718
Reputation: 20
38 / Male / Flag
Joined: Jul 2006
O.P. RE: SendMessage doens't do anything
quote:
Originally posted by CookieRevised
What happens if you uncomment all the commented lines and change the SendMessage text to something very short like "testx", and change the empty string from SetControlText to something else like "test3" (to see if it realy changes the control text)?:
JScript code:
function OngetbackEvent_EditTextChanged(wnd,ic){
        var str =""+wnd.GetControlText(ic).toLowerCase();
        schermpje.SendMessage("test1");
        if(str.search("_")>=0){
                str = str.substring(0,str.length-1);
                if(str == "close"){
                        wnd.Close(36259)
                }else{
                        Debug.Trace("Handle: " + schermpje.Handle);
                        Debug.Trace("Allowed: " + schermpje.EditChangeAllowed);
                        Debug.Trace("SendMsg: " + schermpje.SendMessage("test2"));
                        Debug.Trace("str: "+str);
                        wnd.SetControlText("txtje","test3")
                }
        }
}



The result from the debug window:
Handle: 16975412
Allowed: true
SendMsg: true
str: test3

The text in the messenger window:
test1
test1
test1
test1

The text in the plus window:
test3

And it just got a little stranger...
I noticed this when I used the following code:
Javascript code:
function OngetbackEvent_EditTextChanged(wnd,ic){
        var str =""+wnd.GetControlText(ic).toLowerCase();
        schermpje.SendMessage("test1");
        if(str.search("_")>=0){
                str = str.substring(0,str.length-1);
                if(str == "close"){
                        wnd.Close(36259)
                }else{
                        Debug.Trace("Handle: " + schermpje.Handle);
                        Debug.Trace("Allowed: " + schermpje.EditChangeAllowed);
                        Debug.Trace("SendMsg: " + schermpje.SendMessage("test2"));
                        Debug.Trace("str: "+str);
                        schermpje.SendMessage("test1");
                        wnd.SetControlText("txtje","")
                }
        }
}

When I enter letters it sends test1, but as soon as I enter _ it doesn't... Debug from just entering _ :
code:
> Functieaanroep: "OnEvent_ChatWndReceiveMessage"
> Functieaanroep: "OnEvent_ChatWndReceiveMessage"
> Functieaanroep: "OngetbackEvent_EditTextChanged"
Handle: 19728798
Allowed: true
SendMsg: true
str:
> Functieaanroep: "OngetbackEvent_EditTextChanged"
> Functieaanroep: "OngetbackEvent_EditTextChanged"
Handle: 19728798
Allowed: true
SendMsg: true
str:
> Functieaanroep: "OngetbackEvent_EditTextChanged"
> Functieaanroep: "OngetbackEvent_EditTextChanged"
Handle: 19728798
Allowed: true
SendMsg: true
str:
> Functieaanroep: "OngetbackEvent_EditTextChanged"


I now have the feeling something goes wrong because the SetControlText calls the function again... But I don't understand why that would be a problem...

edit:
ok I tried something different... and it didn't explain anything... but did raise more questions...

Javascript code:
function OngetbackEvent_EditTextChanged(wnd,ic){
        var str =""+wnd.GetControlText(ic).toLowerCase();
        schermpje.SendMessage("test1");
        if(str.search("_")>=0){
                str = str.substring(0,str.length-1);
                if(str == "close"){
                        wnd.Close(36259)
                }else{
                        Debug.Trace("Handle: " + schermpje.Handle);
                        Debug.Trace("Allowed: " + schermpje.EditChangeAllowed);
                        Debug.Trace("SendMsg: " + schermpje.SendMessage("test2"));
                        Debug.Trace("str: "+str);
                        schermpje.SendMessage(""+str);
                        //wnd.SetControlText("txtje","")
                }
        }
}


inserted text in the getback edit field: a__d_a

result in chatwindow:
test1
test1
test1
test2
a__

result in debugwindow:
code:
> Functieaanroep: "OngetbackEvent_EditTextChanged"
Handle: 19728798
Allowed: true
SendMsg: true
str: a
> Functieaanroep: "OngetbackEvent_EditTextChanged"
Handle: 19728798
Allowed: true
SendMsg: true
str: a_
> Functieaanroep: "OngetbackEvent_EditTextChanged"
> Functieaanroep: "OnEvent_ChatWndReceiveMessage"
Handle: 19728798
Allowed: true
> Functieaanroep: "OnEvent_ChatWndReceiveMessage"
SendMsg: true
str: a__
> Functieaanroep: "OnEvent_ChatWndReceiveMessage"
> Functieaanroep: "OngetbackEvent_EditTextChanged"
Handle: 19728798
Allowed: true
SendMsg: true
str: a__d
> Functieaanroep: "OngetbackEvent_EditTextChanged"
Handle: 19728798
Allowed: true
SendMsg: true
str: a__d_
> Functieaanroep: "OngetbackEvent_EditTextChanged"
Handle: 19728798
Allowed: true
SendMsg: true
str: a__d_a


This post was edited on 10-06-2009 at 06:03 PM by foaly.
10-06-2009 04:00 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
SendMessage doens't do anything - by foaly on 10-05-2009 at 03:38 PM
RE: SendMessage doens't do anything - by matty on 10-05-2009 at 04:38 PM
RE: SendMessage doens't do anything - by foaly on 10-06-2009 at 05:44 AM
RE: SendMessage doens't do anything - by CookieRevised on 10-06-2009 at 06:03 AM
RE: SendMessage doens't do anything - by foaly on 10-06-2009 at 06:36 AM
RE: SendMessage doens't do anything - by CookieRevised on 10-06-2009 at 10:53 AM
RE: SendMessage doens't do anything - by foaly on 10-06-2009 at 04:00 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