What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Add items to chatwindow

Add items to chatwindow
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Add items to chatwindow
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? :P)
First of all, if you want to talk Dutch, leave an English version too. :P
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? :P)

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!

This post was edited on 01-14-2007 at 07:30 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!
01-14-2007 07:28 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Add items to chatwindow - by PaulE on 01-14-2007 at 05:25 PM
RE: Add items to chatwindow - by Ezra on 01-14-2007 at 05:46 PM
RE: Add items to chatwindow - by PaulE on 01-14-2007 at 06:04 PM
RE: Add items to chatwindow - by Matti on 01-14-2007 at 07:02 PM
RE: Add items to chatwindow - by PaulE on 01-14-2007 at 07:06 PM
RE: Add items to chatwindow - by Ezra on 01-14-2007 at 07:25 PM
RE: RE: Add items to chatwindow - by PaulE on 01-14-2007 at 07:27 PM
RE: Add items to chatwindow - by Matti on 01-14-2007 at 07:28 PM
RE: Add items to chatwindow - by PaulE on 01-14-2007 at 07:53 PM
RE: RE: Add items to chatwindow - by deAd on 01-14-2007 at 08:17 PM
RE: Add items to chatwindow - by PaulE on 01-14-2007 at 08:21 PM
RE: Add items to chatwindow - by matty on 01-14-2007 at 08:24 PM
RE: Add items to chatwindow - by PaulE on 01-14-2007 at 08:55 PM
RE: Add items to chatwindow - by Mike on 01-14-2007 at 09:14 PM
RE: RE: Add items to chatwindow - by PaulE on 01-14-2007 at 09:22 PM


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