Shoutbox

ChatWnd objects - 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: ChatWnd objects (/showthread.php?tid=64621)

ChatWnd objects by mlevit on 08-07-2006 at 10:39 PM

Hey,

Does anybody know how to iterate through each chat window thats open and send a message to it?

Can't figure it out,

Thanks


RE: ChatWnd objects by ddunk on 08-07-2006 at 10:42 PM

You could always cheat and use Plus' /all command. (I'm too lazy to figure out how to iterate through them all) :P


RE: ChatWnd objects by Silentdragon on 08-07-2006 at 10:43 PM

code:
Debug.Trace("Currently opened chat windows:");
var Windows = Messenger.CurrentChats;
var e = new Enumerator(Windows);
for(; !e.atEnd(); e.moveNext())
{
    var ChatWindow = e.item();
    Debug.Trace(" Handle: " + ChatWindow.Handle);
}

Straight from the documentation, always check there first.
RE: ChatWnd objects by mlevit on 08-07-2006 at 10:50 PM

Silentdragon, thats not it sorry.

That gets me the Contact object, not the actual ChatWnd object that i need to send message.

If you try ChatWindow.SendMessage = "hello";

You'll get: Error: Object doesn't support this property or method.


RE: ChatWnd objects by cloudhunter on 08-07-2006 at 10:54 PM

No, it gets the handle... you can use

code:
ChatWindow.SendMessage("message");

Where it says debug.trace etc...

Edit: Nvm then... why don't you check the advertising script? It has a send to all open windows feature, look at the code.

Cloudy
RE: ChatWnd objects by mlevit on 08-07-2006 at 11:06 PM

Thanks, that works.


RE: ChatWnd objects by cloudhunter on 08-07-2006 at 11:10 PM

You're welcome, I didn't realise that you tried to do a = :$ I just took your word for it it didn't work :P

Cloudy