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:
PaulE
Junior Member
**


Posts: 28
Joined: Jul 2006
O.P. RE: Add items to chatwindow
Hehe i will see where i will place them. Normally my chatwindow is always the same size, and DsiplayPicture is always visible :) Thnx :D

EDIT
I have made some code of what you guys said, but i get an error:
quote:
> Script is gestopt.
> Script wordt gestart.
> Script is succesvol gestart.
> Functieaanroep: "OnEvent_Initialize"
> Functieaanroep: "OnEvent_ChatWndDestroyed"
> Functieaanroep: "OnEvent_ChatWndCreated"
> Fout gedetecteerd in lijn 29: Deze eigenschap of methode wordt niet ondersteund door dit object.
  (Code: -2146827850)
> Fout gedetecteerd in "OnEvent_ChatWndCreated".
  (Code: -2147352567)
> Functieaanroep: "OnEvent_ChatWndSendMessage"

So, the script starts, buy when i create a ChatWnd i get an error on line 29:
code:
    Result = Interop.Call("User32", "GetWindowRect", ChatWnds[ChatWnd.Handle] * 1, RECT);

This is my code:
code:
var ChatWnds = new Array();
var PlusWnds = new Array();

function OnEvent_Initialize(MessengerStart) {

    if(Messenger.MyStatus > 0) {

        for(var e = new Enumerator(Messenger.CurrentChats); !e.atEnd(); e.moveNext()) {

            var ChatWnd = e.item();
            ChatWnds[ChatWnd.Handle] = ChatWnd;
            PlusWnds[ChatWnd.Handle] = MsgPlus.CreateWnd("Buttons.xml", "Buttons", 2);

        }

    }

}

function Onevent_ChatWndCreated(ChatWnd) {

    ChatWnds[ChatWnd.Handle] = ChatWnd;
    PlusWnds[ChatWnd.Handle] = MsgPlus.CreateWnd("Buttons.xml", "Buttons", 2);

    var Result = Interop.Call("User32.dll", "SetParent", PlusWnds[ChatWnd.Handle], ChatWnds[ChatWnd.Handle]);
    Result = Interop.Call("User32.dll", "SetWindowPos", PlusWnds[ChatWnd.Handle], 0, 0, 0, 100, 50, 18);

    var RECT = Interop.Allocate(16);
    Result = Interop.Call("User32", "GetWindowRect", ChatWnds[ChatWnd.Handle] * 1, RECT);
    var CurWidth = RECT.ReadDWORD(8) - RECT.ReadDWORD(0);
    var CurHeight = RECT.ReadDWORD(12) - RECT.ReadDWORD(4);

    var x = CurWidth - 120;
    var y = CurHeight - 250;
    Result = Interop.Call("User32.dll", "SetWindowPos", PlusWnds[ChatWnd.Handle], 0, x, y, 0, 0, 17);

    PlusWnds[ChatWnd.Handle].Visible = true;

}

function OnEvent_ChatWndDestroyed(ChatWnd) {

    var PlusWnd = PlusWnds[ChatWnd.Handle];

    if(PlusWnd != undefined) {
        PlusWnd.Close(0);
    }

    delete ChatWnds[ChatWnd.Handle];
    delete PlusWnds[ChatWnd.Handle];

}

What is the problem? :P

Edit
I added the source as attachment, because this code tags dont works good :P

.txt File Attachment: ChatWnd Handle.txt (2.8 KB)
This file has been downloaded 278 time(s).

This post was edited on 01-14-2007 at 08:02 PM by PaulE.
01-14-2007 07:53 PM
Profile PM 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