Shoutbox

[Release/Updated]Polygamy addition: Window Named as email - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [Release/Updated]Polygamy addition: Window Named as email (/showthread.php?tid=70317)

[Release/Updated]Polygamy addition: Window Named as email by Lou on 01-05-2007 at 05:48 AM

Here is a useful script that Matty created. I requested it, and he gave it to me. He's allowed for this thread to be posted:)

What the script does is simple, it renames your contact list windows to the email address running it. Why? Because when running multiple Windows Live Messenger Instances (polygamy), things can get complicated.

[Image: polygamysuggestionxf2.png]


The code is below, as I haven't created a plsc file for it. Please keep all credits in the script.

code:
/*
Code written by Matty
Don't release without this notice, add your own if you really want, but leave this one there
Modify as you want, except for this notice
*/


function OnEvent_SigninReady() {
    _setText();
}

function OnEvent_ContactListWndCreated() {
    _setText();
}

function OnEvent_Initialize(bMessengerStart){
    _setText();
}

function OnEvent_MessengerUnLocked(){
    MsgPlus.AddTimer('settext', 100); // Note #1
}

function OnEvent_Timer(sTimerId){
    _setText();
}

function _setText(){
    if (Messenger.MyStatus > 1 && Messenger.ContactListWndHandle != 0) {
        var _titlesize = Interop.Call('user32', 'GetWindowTextLengthW', Messenger.ContactListWndHandle)+1;
        var _title = Interop.Allocate((2*_titlesize)+2);
        Interop.Call('user32', 'GetWindowTextW', Messenger.ContactListWndHandle, _title, _titlesize);
        Interop.Call('user32', 'SetWindowTextW', Messenger.ContactListWndHandle, Messenger.MyEmail + ' - ' + _title.ReadString(0));
    }
}

/*
Note #1
We do this because for some odd reason the caption is set back to Windows Live Messenger
and our title we set doesn't stay even tho the window is just hidden and shown again.
*/


edit: code updated:)
RE: Polygamy addition: Window Named as email by matty on 01-05-2007 at 05:52 AM

quote:
Originally posted by .Lou
/*
Note #1
Code written by Matty
Don't release without this notice, add your own if you really want, but leave this one there
Modify as you want, except for this notice
*/
Why is that there, it wasn't in the code lol.
RE: [Release]Polygamy addition: Window Named as email by Lou on 01-05-2007 at 05:55 AM

quote:
Originally posted by Matty
quote:
Originally posted by .Lou
/*
Note #1
Code written by Matty
Don't release without this notice, add your own if you really want, but leave this one there
Modify as you want, except for this notice
*/
Why is that there, it wasn't in the code lol.
I've no idea, it's fixed now though :P
RE: [Release]Polygamy addition: Window Named as email by matty on 01-05-2007 at 10:20 PM

small update

code:
/*
Code written by Matty
Don't release without this notice, add your own if you really want, but leave this one there
Modify as you want, except for this notice
*/


function OnEvent_SigninReady() {
    _setText();
}

function OnEvent_ContactListWndCreated() {
    _setText();
}

function OnEvent_Initialize(bMessengerStart){
    _setText();
}

function OnEvent_MessengerUnLocked(){
    MsgPlus.AddTimer('settext', 100); // Note #1
}

function OnEvent_Timer(sTimerId){
    _setText();
}

function _setText(){
    if (Messenger.MyStatus > 1 && Messenger.ContactListWndHandle != 0) {
        var _titlesize = Interop.Call('user32', 'GetWindowTextLengthW', Messenger.ContactListWndHandle)+1;
        var _title = Interop.Allocate((2*_titlesize)+2);
        Interop.Call('user32', 'GetWindowTextW', Messenger.ContactListWndHandle, _title, _titlesize);
        Interop.Call('user32', 'SetWindowTextW', Messenger.ContactListWndHandle, Messenger.MyEmail + ' - ' + _title.ReadString(0));
    }
}

/*
Note #1
We do this because for some odd reason the caption is set back to Windows Live Messenger
and our title we set doesn't stay even tho the window is just hidden and shown again.
*/