Shoutbox

send Message in a specific windows - 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: send Message in a specific windows (/showthread.php?tid=81084)

send Message in a specific windows by magemello on 01-20-2008 at 05:32 PM

it is possible send message in a specific windows using a Handle Property of  ChatWnd and ChatWnd.SendMessage("message")   command?


RE: send Message in a specific windows by mynetx on 01-20-2008 at 05:39 PM

Sending messages to a specific chat window works as follows:

code:
wndSomeChat.SendMessage("Hi there. :)");

You won't need the ChatWnd.Handle property to send a message.
You may store the chat window object to send a message to this specific window later in the script, such as:
code:
var wndChatWindow;

function someFunctionRunsFirst() {
    wndChatWindow = objChatWnd; // local variable objChatWnd comes from anywhere
}

// ...

function someFunctionRunsLater() {
    // now we decide to send a message to the window we have stored
    if(wndChatWindow) {
        wndChatWindow.SendMessage("Hi there...");
    }
}

RE: send Message in a specific windows by magemello on 01-20-2008 at 06:07 PM

Thank you.... but now i've got another problem... is it possible to send hidden messages? Because i wanted to sent some program datas without the reciever knowing it.


RE: send Message in a specific windows by mynetx on 01-20-2008 at 06:11 PM

When you send messages to a recipient, he/she will always see them unless there is a Plus! script running there which implements the OnEvent_ChatWndReceiveMessage function. That function should return an empty string if the message was data to be received and not to be displayed. (But I'm not sure if the opening chat window will be suppressed.)

/edit:
You will find more information about this topic in the Official Scripting Documentation.


RE: send Message in a specific windows by magemello on 01-20-2008 at 06:17 PM

thank you i didn't think about that.