quote:
Originally posted by Deco
Is there a way to do that?
I know about sending it like this:
myWnd.SendMessage(Msg);
myWnd.SendMessage("/close");
But I needed something that didn't bring the window up because it takes focus out of my program and that messes things up for me.
Thanks
The problem in your request is that messages need to be send to a contact (sounds strange as I write it
).
What I mean is: in order to send a message to a contact you, or messenger or whatever else for that matter, must open a session to that contact. This can only be done:
1- by opening a conversation window
2- by making your own protocol talking thingie which opens the session, talks to the switchboard, deals with server messages, etc
The latter is extremely difficult, and will almost result in your own IM client compatible with the Mssenger protocol anyways. So not so doable in practice or for this purpose.
The former is the only thing you can do. A trick you could do is hiding the chat window once you opened it. But you still need to open it and thus it will stil be 'visible' to the user (even if it was for a brief 100 milliseconds). Not to mention you need to take a lot of issues into account also (eg: make sure the contact is online, he isn't blocked, or check you don't accidently send an SMS, etc).
If it is just to prevent the chat from stealing the focus: that's the way the Plus! script engine works. Plus! _needs_ to bring the chat window in focus in order to be able to send a message. However, once this has been done it _should_ put the focus back to what it was.