What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » HELP - Resizing a child window!

HELP - Resizing a child window!
Author: Message:
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: HELP - Resizing a child window!
First, I was wrong about SetWindowPos();. My apologies. You actually need to use MoveWindow();

Second, you've probably got the first part correct, but the second is kinda.. ya know.. :P

As the scripting docs say, you need to pass the element ID to PlusWnd::GetElementPos(). (It's actually PlusWnd.GetElementPos(ElementID,Type)). So this is what you'll need to do with your PlusWnd:

JScript code:
function RetrievePos(PlusWnd,ElementID) {
    var PosInfo = new Object();
    PosInfo.X = PlusWnd.GetElementPos(ElementID,POSINFO_X /* Predefined within MPL itself */);
    PosInfo.Y = PlusWnd.GetElementPos(ElementID,POSINFO_Y);
    PosInfo.Width = PlusWnd.GetElementPos(ElementID,POSINFO_WIDTH);
    PosInfo.Height = PlusWnd.GetElementPos(ElementID,POSINFO_HEIGHT);
    return PosInfo;
}


Call this function with the parent window object (WndCommandBar_Shell) and the element ID specified in your interface XML.

For MoveWindow(), you need to pass the handle to your child window (WndCommandBar_CMain), its coordinates and size (the information stored in the object returned by my RetrievePos() function) and whether it should be redrawn or not. So it's MoveWindow(hWnd,x,y,width,height,redraw);. Once again, this function is located in User32.dll.

BTW, I recommend redrawing the window through MoveWindow();

This post was edited on 09-12-2009 at 02:54 PM by SmokingCookie.
09-12-2009 02:49 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
HELP - Resizing a child window! - by whiz on 09-12-2009 at 01:28 PM
RE: HELP - Resizing a child window! - by SmokingCookie on 09-12-2009 at 02:24 PM
RE: HELP - Resizing a child window! - by whiz on 09-12-2009 at 02:35 PM
RE: HELP - Resizing a child window! - by SmokingCookie on 09-12-2009 at 02:49 PM
RE: HELP - Resizing a child window! - by whiz on 09-12-2009 at 03:09 PM
RE: HELP - Resizing a child window! - by Matti on 09-12-2009 at 03:32 PM
RE: HELP - Resizing a child window! - by whiz on 09-13-2009 at 09:59 AM
RE: HELP - Resizing a child window! - by SmokingCookie on 09-12-2009 at 03:33 PM
RE: HELP - Resizing a child window! - by Matti on 09-12-2009 at 03:42 PM
RE: HELP - Resizing a child window! - by SmokingCookie on 09-12-2009 at 03:46 PM
RE: HELP - Resizing a child window! - by Matti on 09-13-2009 at 10:10 AM
RE: HELP - Resizing a child window! - by whiz on 09-13-2009 at 10:33 AM
RE: HELP - Resizing a child window! - by SmokingCookie on 09-14-2009 at 07:39 AM
RE: HELP - Resizing a child window! - by whiz on 09-14-2009 at 03:55 PM
RE: HELP - Resizing a child window! - by Matti on 09-14-2009 at 05:20 PM
RE: HELP - Resizing a child window! - by SmokingCookie on 09-14-2009 at 05:20 PM
RE: HELP - Resizing a child window! - by whiz on 09-14-2009 at 05:58 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