Shoutbox

Close a 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 a Chat Window (/showthread.php?tid=70511)

Close a Chat Window by questsin on 01-10-2007 at 01:49 AM


Hi,

I've just started using messenger plus and its very useful. I even ported my Chatbot application (questsin@hotmail.com). 

After reading MPLScripting documentation I can't seem to grasp how to close a current chat window.

I checked the members and properties of "ChatWnd" and ChatWnds to no avail.

Anyone know howto close an open ChatWnd?

thanks


RE: Close a Chat Window by NanaFreak on 01-10-2007 at 01:51 AM

send a message to the window you want of "/close"

in the code it will be:

code:
ChatWnd.SendMessage("/close");
you can change Chatwnd to the window variable you are wanting ;)
RE: Close a Chat Window by matty on 01-10-2007 at 02:12 AM

code:
ChatWnd.Close(0);

code:
Interop.Call('user32', 'SendMessageW', ChatWnd.Handle, 0x0010/*WM_CLOSE*/, 0, 0);

There are lots of ways.
RE: RE: Close a Chat Window by deAd on 01-10-2007 at 02:30 AM

quote:
Originally posted by Matty
code:
ChatWnd.Close(0);

ChatWnd has no close method...
RE: Close a Chat Window by questsin on 01-10-2007 at 02:38 AM

works great. thanks


RE: Close a Chat Window by Matti on 01-10-2007 at 02:04 PM

code:
ChatWnd.SendMessage("/close");
That'll only work if the typing area is active, think of doing this when you've blocked that contact...
code:
Interop.Call('user32', 'SendMessageW', ChatWnd.Handle, 0x0010/*WM_CLOSE*/, 0, 0);
That's the best thing you can do. :)

[OFFTOPIC] @Matty: place your [s][/s] tags in your code block. ;) [/OFFTOPIC]
RE: Close a Chat Window by matty on 01-10-2007 at 02:49 PM

quote:
Originally posted by Mattike
code:
ChatWnd.SendMessage("/close");
That'll only work if the typing area is active, think of doing this when you've blocked that contact...
code:
Interop.Call('user32', 'SendMessageW', ChatWnd.Handle, 0x0010/*WM_CLOSE*/, 0, 0);
That's the best thing you can do. :)
There are a lot of other API's you can use.
DestroyWindow - Not the best or even recommended solution.
PostMessageW with WM_CLOSE message

quote:
Originally posted by Mattike
[OFFTOPIC] @Matty: place your [s][/s] tags in your code block. ;) [/OFFTOPIC]
It works fine in IE6 which is what I was using at work at the time.