What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Check if window is already open?

Check if window is already open?
Author: Message:
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
32 / Male / Flag
Joined: Jul 2006
O.P. Check if window is already open?
Ive been told to ask this by Spunky because his internet is fuxxored.

Is there any other way of ensuring that only one instance of a window is open other than using:
code:
try{
wnd.close(1);
}catch(E){}

09-04-2007 05:16 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Check if window is already open?
Well, the way I do it is by creating a global array where I store all my opened PlusWnd objects in. Then, in my general window creator function, I say that if typeof Wnd[WndId] == "object", it should focus the existing window instead of opening a new one. But you must remember that in all OnWndIdEvent_Destroyed events, you should set the value of the window's member in the array to false, or remove it from the array.

You can see a working example of this in all of my scripts, the most recent is Log Manager, but Countdown Live and Calculator also have such (older) functions. Feel free to copy/modify/mess with the code you need to do this, but please ask for permission if you want to copy some other sh*t. :P

This post was edited on 09-04-2007 at 06:52 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
09-04-2007 06:52 PM
Profile E-Mail PM Web 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