What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] Detecting when a Plus! Window is closed

[?] Detecting when a Plus! Window is closed
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] Detecting when a Plus! Window is closed
Store the WindowIds in an object and on Destroy delete them and when you need to check if they are open iterate through the object and see if they exist.

Javascript code:
var objWindows = {};
 
function OpenWindow(Name, XML, ShowCode){
    if (typeof objWindows[Name] === 'object' && typeof objWindows[Name].Handle === 'number' && Interop.Call('user32', 'IsWindow', objWindows[Name].Handle) {
        Interop.Call('user32', 'SetForegroundWindow', objWindows[Name].Handle);
        return objWindows[Name];
    }
    if (typeof(ShowCode) === 'undefined') ShowCode = 0;
   
    objWindows[Name] = MsgPlus.CreateWnd(XML, Name, ShowCode);
    return objWindows[Name];
}
 
function CheckIfWindowExists ( Name ) {
    for ( objWindow in objWindows ) {
        if ( objWindow === Name ) return true;
    }
    return false;
}
 
function OnWindowIdEvent_Destroyed(pPlusWnd) {
    delete objWindows[pPlusWnd.WindowId];
}


Something along those lines ;)

This post was edited on 10-14-2009 at 01:01 PM by matty.
10-13-2009 01:17 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[?] Detecting when a Plus! Window is closed - by ryxdp on 10-13-2009 at 08:36 AM
RE: [?] Detecting when a Plus! Window is closed - by matty on 10-13-2009 at 01:17 PM
RE: [?] Detecting when a Plus! Window is closed - by ryxdp on 10-14-2009 at 03:10 AM
RE: [?] Detecting when a Plus! Window is closed - by Matti on 10-14-2009 at 12:08 PM
RE: RE: [?] Detecting when a Plus! Window is closed - by ryxdp on 10-14-2009 at 10:46 PM
RE: RE: [?] Detecting when a Plus! Window is closed - by CookieRevised on 10-16-2009 at 05:47 PM
RE: RE: RE: [?] Detecting when a Plus! Window is closed - by ryxdp on 10-16-2009 at 11:13 PM
RE: [?] Detecting when a Plus! Window is closed - by Matti on 10-16-2009 at 03:33 PM
RE: [?] Detecting when a Plus! Window is closed - by CookieRevised on 10-16-2009 at 11:50 PM
RE: RE: [?] Detecting when a Plus! Window is closed - by ryxdp on 10-17-2009 at 12:06 AM
RE: [?] Detecting when a Plus! Window is closed - by Matti on 10-17-2009 at 08:55 AM


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