[OK]SendMessage Function |
Author: |
Message: |
Lén
Junior Member
Posts: 16
35 / /
Joined: Feb 2008
|
O.P. [OK]SendMessage Function
Hey it's me, again
well, i would send a message in a window ... not that hard if i want to send it to the last personn who has talk to me, but ... if i want to choose another personn ?
I've found in the Help that i should use SendMessage:
http://msdn.microsoft.com/en-us/library/ms644950(VS.85).aspx
But how can i use it in the msg plus! Jscript ?
i've tried:
han = 2425418
SendMessage(han,"my string",0,0);
but t doesn't work .... i caught the handle with:
var e = new Enumerator(Windows);
for(; !e.atEnd(); e.moveNext())
{
var ChatWindow = e.item();
Debug.Trace(" Handle: " + ChatWindow.Handle);
}
Thanks !
This post was edited on 08-10-2009 at 07:49 PM by Lén.
|
|
08-09-2009 10:12 PM |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
Joined: Aug 2006
|
RE: SendMessage Function
You want the ChatWindow object, not the handle. Then use it like
js code: ChatWindow.SendMessage("blah");
<Eljay> "Problems encountered: shit blew up"
|
|
08-09-2009 11:00 PM |
|
|
Lén
Junior Member
Posts: 16
35 / /
Joined: Feb 2008
|
O.P. RE: SendMessage Function
You didn't read my message !
If you have 3 chat windows opened, how do you know wich window it will be send ?
i can't use your code 'cause it send the msg to the "active" window ....
This post was edited on 08-09-2009 at 11:29 PM by Lén.
|
|
08-09-2009 11:26 PM |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
Joined: Aug 2006
|
RE: SendMessage Function
I did read it but I assumed you would understand...
Use this to send to someone on your contact list...
js code: for(var e = new Enumerator(Messenger.MyContacts); !e.atEnd(); e.moveNext()){
if(e.item().Email == "Person you want to send message to"){
e.item().SendMessage("blah");
//e.item() = ChatWnd object
}
}
Use this to send to someone who you have an open window with
js code: for(var e = new Enumerator(ChatWnd.Contacts); !e.atEnd(); e.moveNext()){
if(e.item().Email == "Person you want to send message to"){
e.item().SendMessage("blah");
//e.item() = ChatWnd object
}
}
This post was edited on 08-10-2009 at 09:14 AM by Spunky.
<Eljay> "Problems encountered: shit blew up"
|
|
08-09-2009 11:46 PM |
|
|
Lén
Junior Member
Posts: 16
35 / /
Joined: Feb 2008
|
O.P. RE: SendMessage Function
I Love You <3
Errrr...
Thanks A lot !!!!
EDIT:
I can't use the first cause i've never used Enumerator so ... where can I put SendMessage ? how ?
and the second, with opened windows ... tell me that ChatWnd is undefined (but i have 2 chats opened, and i'm online ... and for this one, i don't know either where and how to use SendMessage here.
Is that e.SendMessage ( errr no it doesn't work).
Sorry but i've started Javascript, Jscript and xml 3 days ago, i'm in love with ruby, it's lotta easier.
This post was edited on 08-10-2009 at 02:58 AM by Lén.
|
|
08-10-2009 02:23 AM |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
Joined: Aug 2006
|
RE: SendMessage Function
Edited previous post. I made a bit of a mistake...
It's:
code: e.item().SendMessage("this is a message");
It is the e.item() you want, not e.SendMessage;
<Eljay> "Problems encountered: shit blew up"
|
|
08-10-2009 09:16 AM |
|
|
Lén
Junior Member
Posts: 16
35 / /
Joined: Feb 2008
|
O.P. RE: SendMessage Function
Yey but .... no
i've already tried, and i've just retried with your code,
the debug tell me that e.item doesn't use this property or method on
code: e.item().SendMessage("blah");
This post was edited on 08-10-2009 at 12:02 PM by Lén.
|
|
08-10-2009 12:02 PM |
|
|
Mnjul
forum super mod
plz wub me
Posts: 5396 Reputation: 58
– / /
Joined: Nov 2002
Status: Away
|
RE: SendMessage Function
Spunky and Lén: you can't apply SendMessage() to a Contact object. You need to chatWnd=Messenger.OpenChat(e.item()) and then chatWnd.SendMessage("the message").
|
|
08-10-2009 12:28 PM |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
Joined: Aug 2006
|
RE: SendMessage Function
Ah, got confused with the original code... I knew it was the chatwnd object, but forgot that returned a contact...
<Eljay> "Problems encountered: shit blew up"
|
|
08-10-2009 12:53 PM |
|
|
Lén
Junior Member
Posts: 16
35 / /
Joined: Feb 2008
|
|
08-10-2009 07:49 PM |
|
|
|