What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » How to close a chat window with tabs and activated previously active window?

How to close a chat window with tabs and activated previously active window?
Author: Message:
V@no
Full Member
***

Avatar
sexy

Posts: 162
Joined: Mar 2004
O.P. How to close a chat window with tabs and activated previously active window?
Hello!

Here is my situation:
I'm using tabbed chat windows and desktop contacts (these floating names).
When I drag and drop text to a specific desktop contact (contact1) and text matches specific criteria (link to a known website), it automatically closes the window.
So far it works fine, but, if I had a chat window opened with different person (contact2) and that window was on background/minimized, then after my script closes the chat window with contact1 it leaves chat window with contact2 in focus/active.

My question is, how to make sending messages on background without interfering with currently active windows/programs?

I guess a work around for this would be:
1) send message without opening any chat window (somehow I don't believe it's even possible)
2) before opening chat window record which window/program was active, then after message sent and chat window closed, activate that program/window.

Either way I don't know how to do it...

Can someone help?

Thank you.
11-01-2009 12:10 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: How to close a chat window with tabs and activated previously active window?
You can't send a message without opening a window (that is: not without handling protocol messages yourself).

Your second suggestion will work, but the z-order of windows will also change when you put the previous on-top window back on top. And don't forget to also record the window state (minimize or not) and setting it again to this state afterwards. This is what happens when you implement your second suggestion:

Before:       When sending:    After:
Program1      Program1         Program1
Contact1      Program2         Program2
Program2      Program3         Program3
Program3      Program4         Contact1
Program4      Contact1         Program4


So, you see the Contact1 window is not exactly in the same z-position anymore like it was before. Normally it doesn't matter much, but still...

If you don't want that you could also record the current z-order of the open chat window and place it again in that position after closing the other one. Again, also recording the windows' state.

Of course, all this should only be done when tabbed chats are enabled and there is at least one chat window open. Otherwise it would be useless.

Also, make sure you first check to see if there isn't already a chat open with that contact you want to send a message too. Although you still must check the z-order and set it again like it was after sending the message, you don't want to close that chat window in that case.

At the moment I can't give you the exact code for all this because of lack of time, but at least you (or anyone wanting to code this) have some ideas now I hope. It involves some Windows APIs, which can be found on the MSDN library under 'windows functions'.

This post was edited on 11-01-2009 at 02:21 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
11-01-2009 02:14 PM
Profile 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