All this talk about ChatWnd is making my head spin, but I think I got a good idea.
I dont think its SendMessage that draws the windows focus, its the OpenChat. So if I dont do that, and just use the ChatWnd Iterator and then see if the contact I want to send it to is in the chat (and there is only 1 person in the chat) to then send the message. Thus, avoiding the OpenChat.
I'll try it and see if it works.
EDIT:
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();
if (ChatWindow.Contacts.Count == 1){
var f = new Enumerator(ChatWindow.Contacts);
for(; !f.atEnd(); f.moveNext()){
var Contact = f.item();
Debug.Trace(" " + Contact.Email);
}
}
}
That what I made, it works to
. Might also be able to be used in my IRC Style Chats script aswell.
Thanks for your help everyone.
EDIT 2 :
Heres a BETA version of the script. Its getting there
.
This version is mostly operational, it just dosn't have advanced settings (Like, dont send to this contact when they are busy).
Also checks if Music Now Playing is installed.
http://bigbob85.insaneparadox.com/msgplus/script.php?scr=NP%20Updater