Try this instead
code:
function OnEvent_ChatWndCreated(ChatWnd)
{
var ChatWndContacts = ChatWnd.Contacts;
if(ChatWndContacts.Count == 1)
{
var e = new Enumerator(ChatWndContacts);
var Contact = e.item();
{
MsgPlus.DisplayToastContact(Messenger.MyName ,"Opened a Chat Window With", Contact.Name ,"CHIMES.WAV");
}
}
}
Though it doesn't matter if it is you or your contact that creates the window it will always say it's you. I really don't know how to change this so it only happens on you opening the chat window (like i think you want gthered by your code)
EDIT: Ddunk's post explains it better and so does his code, I just used the DisplayToastContact because I keep forgetting how to do the extra line stuff
also I have it only come up if there is only one contact in the chat (this is done by the fourth line)