Shoutbox

Closing 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: Closing a chat window (/showthread.php?tid=89988)

Closing a chat window by pinhead on 03-30-2009 at 06:33 PM

Is it possible to close a normal chat window? I found OpenChat, but nothing to close this windows again..
And another question, but I don't think this is possible: Is there a way to reorganize the tabs in the chat window. Like exchanging positions of two tabs and alike?


RE: Closing a chat window by NanaFreak on 03-30-2009 at 08:21 PM

the first one is possible with ChatWndObj.close(0);

but sorry the second one is not possible... unless you close the windows and re-open them but thats not nice


RE: Closing a chat window by Spunky on 03-30-2009 at 08:33 PM

quote:
Originally posted by NanaFreak
the first one is possible with ChatWndObj.close(0);

No, it's not? ^o)
RE: Closing a chat window by matty on 03-30-2009 at 09:07 PM

You have to use the SendMessage API sending WM_CLOSE not ChatWndObj.Close(0);


RE: Closing a chat window by afallenhope on 04-13-2009 at 01:56 AM

just a quick question, how exactly would you do this?
SendMessage(ChatWnd.handle, WM_CLOSE,0) but how do you use API in JS?  Forgive me for my ignorance, but I've been wondering how to do this for some time aswell.


RE: Closing a chat window by ryxdp on 04-13-2009 at 02:02 AM

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


That should do it :)
RE: Closing a chat window by SmokingCookie on 04-13-2009 at 01:36 PM

JScript code:
Interop.Call("User32.dll","DestroyWindow",ChatWnd.Handle);


No SendMessage(W) stuff, just a simple function that does the work for ya.
RE: Closing a chat window by afallenhope on 04-13-2009 at 10:50 PM

thanks guys.
didn't know you can use WindowAPI using pure JScript.. kinda dangerous if you think of it lol. Powerful.. I like it lol.


RE: RE: Closing a chat window by ryxdp on 04-13-2009 at 10:53 PM

quote:
Originally posted by afallenhope
thanks guys.
didn't know you can use WindowAPI using pure JScript.. kinda dangerous if you think of it lol. Powerful.. I like it lol.

Yes, well, that's why we have people (? or is it just MenthiX?) who moderate submissions to the scripting database :P

EDIT: @SmokingCookie: you can also lop a few bytes off of that one, just have "user32" instead of that and the extension :P
RE: RE: RE: Closing a chat window by SmokingCookie on 04-14-2009 at 12:40 PM

quote:
Originally posted by ryxdp
quote:
Originally posted by afallenhope
thanks guys.
didn't know you can use WindowAPI using pure JScript.. kinda dangerous if you think of it lol. Powerful.. I like it lol.

Yes, well, that's why we have people (? or is it just MenthiX?) who moderate submissions to the scripting database :P

EDIT: @SmokingCookie: you can also lop a few bytes off of that one, just have "user32" instead of that and the extension :P

I just love extensions :P

All Windows API functions are available in JScript through the Interop.Call() function, except for those which asynchronous callback functions. See the scripting documentation for more details on the Call() method.