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
Well,...
  1. First of all you need to make a window with a WindowTmpl (ChildTmpl don't work and DialogTmpl looks ugly) which has your two buttons. Then, you can eventually remove the borders. (look in the documentation)
  2. Now, you need to create your window but don't show it yet.
    code:
    var PlusWnd = MsgPlus.CreateWnd("Windows.xml", "MyWnd", 2); //The 2 prevents it from being visible when it's created
  3. Here's the big trick: you have to set the chat window as the parent of the window:
    code:
    var Result = Interop.Call("User32.dll", "SetParent", PlusWnd.Handle, ChatWnd.Handle); //Make sure ChatWnd is valid. Result can be used to check if the function succeeded.
  4. Set the width and height of the window
    code:
    var Result = Interop.Call("User32.dll", "SetWindowPos", PlusWnd.Handle, 0, 0, 0, 100, 50, 18); //100 is the width, 50 is the height
  5. Position your window in the chat window. We'll place it 250 pixels from the bottom and 120 pixels from the right. Therefore, we first need the size of the chat window.
    code:
    var RECT = Interop.Allocate(16);
    var Result = Interop.Call("User32", "GetWindowRect", 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;
    var Result = Interop.Call("User32.dll", "SetWindowPos", PlusWnd.Handle, 0, x, y, 0, 0, 17);
  6. Now, make it visible! :D
    code:
    PlusWnd.Visible = true
The problem is that when you resize the window, our window will disappear. Therefore, you need to add a timer which repositions the timer every x seconds, somewhere between 100 to 500 milliseconds should do. In other words: add a timer event which repeats step 5 every 100 milliseconds. ;)

All credits go to Timezone by Shondoit!


[OFFTOPIC]Ik ben ook Nederlandstalig (Vlaams) hoor! :tongue:[/OFFTOPIC]
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:02 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