quote:
Originally posted by PaulE
quote:
Originally posted by Mattike
...
Haha, bedankt, dit ziet er een stuk simpeler uit dan dat van TimeZone
. Ik werk zelf niet veel hiermee, dus dan wordt ik graag een handje geholpen
Ik zal is kijken hoever ik hiermee kom! Bedankt! 
(Moet ik stap 2 uitvoeren als iemand zich aanmeld ofzo?
)
First of all, if you want to talk Dutch, leave an English version too.
quote:
Originally posted by PaulE
quote:
Originally posted by Mattike
...
Heh, thanks, this looks a lot more simple than the one from TimeZone
. I don't work a lot with this myself, so I like to get some help
I'll see how far I get with this! Thanks!
(Do I have to execute step 2 when someone signs in or what?
)
In fact, you should store all your PlusWnds and ChatWnds in an array. So, on top of your script you place:
code:
var ChatWnds = new Array();
var PlusWnds = new Array();
And in your step 2, you should add:
code:
ChatWnds[ChatWnd.Handle] = ChatWnd;
PlusWnds[ChatWnd.Handle] = PlusWnd;
When you don't do that, you can't make a timer!
The whole code block should be executed when a chat window is created, so in the OnEvent_ChatWndCreated. There, you also have ChatWnd as parameter!
code:
function OnEvent_ChatWndCreated(ChatWnd) {
//Here the code
}
You should also check if the script is started while the user is already signed in and has some conversations opened. Therefore, you need an OnEvent_Initialize and check if the user is signed in. If so, you should loop through all opened conversations and execute the code for every window.
code:
function OnEvent_Initialize(MessengerStart) {
if(Messenger.MyStatus > 0) { //Checks if the user is signed in
for(var e = new Enumerator(Messenger.CurrentChats); !e.atEnd(); e.moveNext()) {
var ChatWnd = e.item();
//Here the code
}
}
}
And when a chat window is destroyed, you should remove the ChatWnd and PlusWnd from the arrays.
code:
function OnEvent_ChatWndDestroyed(ChatWnd) {
var PlusWnd = PlusWnds[ChatWnd.Handle];
if(PlusWnd != undefined) {
PlusWnd.Close(0);
}
delete ChatWnds[ChatWnd.Handle];
delete PlusWnds[ChatWnd.Handle];
}
NOTE: I hope you're aware of the problems you can get when you place your buttons there? You can hide the display pictures, you can have a dynamic picture,... and those things aren't easy to work around!