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

Close a Chat Window
Author: Message:
questsin
New Member
*


Posts: 14
Joined: Jan 2007
O.P. Close a Chat Window

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
01-10-2007 01:49 AM
Profile E-Mail PM Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: Close a Chat Window
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 ;)

This post was edited on 01-10-2007 at 01:51 AM by NanaFreak.
01-10-2007 01:51 AM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Close a Chat Window
code:
ChatWnd.Close(0);

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

There are lots of ways.

This post was edited on 01-10-2007 at 02:49 PM by matty.
01-10-2007 02:12 AM
Profile E-Mail PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: RE: Close a Chat Window
quote:
Originally posted by Matty
code:
ChatWnd.Close(0);

ChatWnd has no close method...
01-10-2007 02:30 AM
Profile PM Find Quote Report
questsin
New Member
*


Posts: 14
Joined: Jan 2007
O.P. RE: Close a Chat Window
works great. thanks
01-10-2007 02:38 AM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: Close a Chat Window
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]
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
01-10-2007 02:04 PM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Close a Chat Window
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.
01-10-2007 02:49 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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