What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Window Close after Signout

Window Close after Signout
Author: Message:
mickael9
Full Member
***


Posts: 117
Reputation: 3
33 / Male / Flag
Joined: Jul 2005
RE: Window Close after Signout
quote:
Originally posted by Eagle_Erwin
I'm trying to make a script that closes the conversation-window when a contact signs out.

The code I have now:

code:
function OnEvent_ContactSignout(Email){
    var contact=Messenger.MyContacts.GetContact(Email);
    var chats = Messenger.CurrentChats;
        var e = new Enumerator(contacts);
        for(; !e.atEnd(); e.moveNext()){
            var chat = e.item();
            var contact1=chat.Contacts
            if(contact==contact1){
                chat.Close();
            }
        }
}


But, this doesn't work. What is wrong in this script, or what script can I use to close the conversation window of the person that signs out?


Hi,
this should work :
code:
function OnEvent_ContactSignout(sEmail)
{
    CloseWindows();
}
function OnEvent_ChatWndContactRemoved(ChatWnd, sEmail)
{
    CloseWindows();
}
function CloseWindows()
{
    var chats = Messenger.CurrentChats;
    var e = new Enumerator(chats);

    for(; !e.atEnd(); e.moveNext())
    {
        var chat = e.item();
        var e2 = new Enumerator(chat.Contacts);
        var bCanClose = true;
        for (; !e2.atEnd(); e2.moveNext())
        {
            var contact = e2.item();
            bCanClose &= (contact.Status != 1);
        }
        if (bCanClose)
            Interop.Call("user32","SendMessageW", chat.Handle, 16, 0, 0);
    }
}

It works when :
You are in a conversation with 1 contact and he signs out
You are in a conversation with 5 contacts, 2 signs out and 3 leaves the conversation.

This post was edited on 08-20-2006 at 10:28 PM by mickael9.
08-20-2006 10:22 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Window Close after Signout - by Eagle_Erwin on 08-20-2006 at 09:07 PM
RE: Window Close after Signout - by Spunky on 08-20-2006 at 09:42 PM
RE: RE: Window Close after Signout - by Eagle_Erwin on 08-20-2006 at 10:00 PM
RE: Window Close after Signout - by artfuldodga on 08-20-2006 at 09:48 PM
RE: Window Close after Signout - by Spunky on 08-20-2006 at 09:50 PM
RE: Window Close after Signout - by Spunky on 08-20-2006 at 10:06 PM
RE: Window Close after Signout - by Eagle_Erwin on 08-20-2006 at 10:08 PM
RE: Window Close after Signout - by CookieRevised on 08-20-2006 at 10:20 PM
RE: RE: Window Close after Signout - by Eagle_Erwin on 08-20-2006 at 10:31 PM
RE: RE: RE: Window Close after Signout - by Jesus on 08-20-2006 at 11:19 PM
RE: Window Close after Signout - by mickael9 on 08-20-2006 at 10:22 PM
RE: Window Close after Signout - by Spunky on 08-20-2006 at 10:23 PM
RE: Window Close after Signout - by absorbation on 08-20-2006 at 10:28 PM
RE: Window Close after Signout - by CookieRevised on 08-20-2006 at 10:49 PM
RE: RE: Window Close after Signout - by mickael9 on 08-20-2006 at 11:33 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On