Shoutbox

Close Chat Window - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Close Chat Window (/showthread.php?tid=79411)

Close Chat Window by Luca on 11-27-2007 at 03:39 PM

HI..:D
what's the code to close a chat window that i opened with OpenChat()?


RE: Close Chat Window by matty on 11-27-2007 at 03:44 PM

code:
var oChatWnd = Messenger.OpenChat("johndoe@hotmail.com");
oChatWnd.Close(0);

RE: Close Chat Window by Luca on 11-29-2007 at 06:58 PM

thank you...;)


RE: Close Chat Window by Luca on 12-06-2007 at 09:03 PM

this code don't work..

code:
var finestra = Messenger.OpenChat(contatto.Email);
finestra.Close();
I can open the chat window,but I can't to close because this function genrate this error...
code:
Errore: Proprietà o metodo non supportati dall'oggetto (codice: -2146827850)
       File: example.js. Linea: 27.

I think that the function Close() close a window,not a CHATwindow....
RE: Close Chat Window by felipEx on 12-06-2007 at 09:16 PM

it's basically what matty said, but.. using API

code:
var oChatWnd = Messenger.OpenChat("johndoe@hotmail.com");
Interop.Call("user32", "SendMessageW", oChatWnd.Handle, 0x10 /*WM_CLOSE*/, 0,0);
;)
RE: RE: Close Chat Window by vikke on 12-06-2007 at 09:18 PM

quote:
Originally posted by Luca
this code don't work..
code:
var finestra = Messenger.OpenChat(contatto.Email);
finestra.Close();
I can open the chat window,but I can't to close because this function genrate this error...
code:
Errore: Proprietà o metodo non supportati dall'oggetto (codice: -2146827850)
       File: example.js. Linea: 27.

I think that the function Close() close a window,not a CHATwindow....
True, you cannot close a chat window using the Close method since it's not available for the ChatWnd object.
Close it using the Win32 API:
code:
Interop.Call("user32", "DestroyWindow", oChatWnd.Handle);


RE: Close Chat Window by Luca on 12-06-2007 at 09:25 PM

Thank you..I solve the problem...:d


RE: Close Chat Window by NanaFreak on 12-06-2007 at 11:38 PM

quote:
Originally posted by Luca
finestra.Close(0);

RE: Close Chat Window by Spunky on 12-06-2007 at 11:53 PM

or

code:
finestra.SendMessage("/Close")

;)
RE: Close Chat Window by markee on 12-07-2007 at 05:42 AM

quote:
Originally posted by SpunkyLoveMuff
or

code:
finestra.SendMessage("/Close")

;)
That won't work when you don't have access to the typing area.  You are far better either using the Windows API or what NanaFreak posted so that the script doesn't fail.
RE: Close Chat Window by Spunky on 12-07-2007 at 07:42 AM

You could alwaysa check first. I was just offering another alternative :p


RE: RE: Close Chat Window by yuping on 12-10-2007 at 03:26 PM

quote:
Originally posted by felipEx
it's basically what matty said, but.. using API
code:
var oChatWnd = Messenger.OpenChat("johndoe@hotmail.com");
Interop.Call("user32", "SendMessageW", oChatWnd.Handle, 0x10 /*WM_CLOSE*/, 0,0);
;)

This code is working correctly!
DestroyWindow function doesn't work with v4.50
RE: Close Chat Window by markee on 12-11-2007 at 07:33 AM

It works perfectly fine for me.

Windows XP Service Pack 2 (5.1.2600)
Windows Live Messenger 8.5.1018
Messenger Plus! Live 4.50.0.310
Skin: Ev0 3.0

Make sure you are not using that email address or you might run into problems.