Shoutbox

[Request] Custom Contact List Title - 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: [Request] Custom Contact List Title (/showthread.php?tid=88305)

[Request] Custom Contact List Title by Knucks on 01-11-2009 at 05:13 PM

I have been using polygamy for a while now and was wondering if it is possible to change the contact list title bar text to determine the right account for the right contact list.

For example:
[Image: WindowClippings_26234.png]

Instead of them both being "Windows Live Messenger":
Left: "Account1"
Right: "Account2"

This way it will be obvious for people using polygamy to see what contact list is the correct one.
Is it possible with a script?


RE: [Request] Custom Contact List Title by warmth on 01-11-2009 at 05:20 PM

that is more a suggestion for patch in the beta forums that for here :P I think...


RE: [Request] Custom Contact List Title by matty on 01-11-2009 at 05:39 PM

quote:
Originally posted by warmth
that is more a suggestion for patch in the beta forums that for here :P I think...
It isn't that hard to do... simple with a script.

Javascript code:
function OnEvent_Initialize(bMessengerStart) { OnEvent_ChatListWndCreated(); }
function OnEvent_SigninReady(sEmail) { OnEvent_ChatListWndCreated(); }
function OnEvent_ChatListWndCreated() {
    if (Messenger.ContactListWndHandle === 0) return;
    var lpsz = Interop.Allocate(2*Messenger.MyEmail.length+2);
    lpsz.WriteString(0, Messenger.MyEmail);
    Interop.Call('user32', 'SendMessageW', Messenger.ContactListWndHandle, 0xC /* WM_SETTEXT */, 0, lpsz.DataPtr);
}


RE: [Request] Custom Contact List Title by Knucks on 01-11-2009 at 06:22 PM

quote:
Originally posted by matty

Javascript code:
function OnEvent_Initialize(bMessengerStart) { OnEvent_ChatListWndCreated(); }
function OnEvent_SigninReady(sEmail) { OnEvent_ChatListWndCreated(); }
function OnEvent_ChatListWndCreated() {
    if (Messenger.ContactListWndHandle === 0) return;
    var lpsz = Interop.Allocate(2*Messenger.MyEmail.length+2);
    lpsz.WriteString(0, Messenger.MyEmail);
    Interop.Call('user32', 'SendMessageW', Messenger.ContactListWndHandle, 0xC /* WM_SETTEXT */, 0, lpsz.DataPtr);
}


Thanks for your help, but for some reason the title text only changes when the account is signed into. If the contact list for that account is closed and then reopened, the text no longer changes.

RE: [Request] Custom Contact List Title by matty on 01-11-2009 at 06:30 PM

Javascript code:
function OnEvent_Initialize(bMessengerStart) { OnEvent_ContactListWndCreated(); }
function OnEvent_SigninReady(sEmail) { OnEvent_ContactListWndCreated(); }
function OnEvent_ContactListWndCreated() {
    if (Messenger.ContactListWndHandle === 0) return;
    var lpsz = Interop.Allocate(2*Messenger.MyEmail.length+2);
    lpsz.WriteString(0, Messenger.MyEmail);
    Interop.Call('user32', 'SendMessageW', Messenger.ContactListWndHandle, 0xC /* WM_SETTEXT */, 0, lpsz.DataPtr);
}


Wow I screwed that one up HUGE!

I had ChatListWndCreated not ContactListWndCreated...
RE: [Request] Custom Contact List Title by Knucks on 01-11-2009 at 06:40 PM

Haha, no problem, I appreciate your help.
Working perfectly :D

However, I do have one additional request :P Since every account is different, I was wondering if a "check" could be done to see what email it is and change the contact list title text relevant to the email.

I'm not sure how this is done in .js but something like this:

if (email == blah@live.com) return "Account1"
else if (email == moreblah@live.com) return "Account2"

Any ideas? :P


RE: [Request] Custom Contact List Title by Mnjul on 01-11-2009 at 07:11 PM

Javascript code:
function OnEvent_Initialize(bMessengerStart) { OnEvent_ContactListWndCreated(); }
function OnEvent_SigninReady(sEmail) { OnEvent_ContactListWndCreated(); }
function OnEvent_ContactListWndCreated() {
    if (Messenger.ContactListWndHandle === 0) return;
    var title = getTitle();
    var lpsz = Interop.Allocate(2*title.length+2);
    lpsz.WriteString(0, title);
    Interop.Call('user32', 'SendMessageW', Messenger.ContactListWndHandle, 0xC /* WM_SETTEXT */, 0, lpsz.DataPtr);
}
 
function getTitle(){
    if(Messenger.MyEmail == "blah@live.com") return "Account 1";
    else if(Messenger.MyEmail == "moreblah@live.com") return "Account 2";
    else return "Your WLM has been hacked!";
}


RE: [Request] Custom Contact List Title by matty on 01-11-2009 at 07:11 PM

Javascript code:
function OnEvent_Initialize(bMessengerStart) { OnEvent_ContactListWndCreated(); }
function OnEvent_SigninReady(sEmail) { OnEvent_ContactListWndCreated(); }
function OnEvent_ContactListWndCreated() {
    if (Messenger.ContactListWndHandle === 0) return;
    var str;
    switch (Messenger.MyEmail) {
        case 'johndoe@hotmail.com':
            str = 'Account 1';
            break;
        case 'johndoe@live.com':
            str = 'Account 2';
            break;
        default:
            str = Messenger.MyEmail;
            break
    }
   
    var lpsz = Interop.Allocate(2*str.length+2);
    lpsz.WriteString(0, str);
    Interop.Call('user32', 'SendMessageW', Messenger.ContactListWndHandle, 0xC /* WM_SETTEXT */, 0, lpsz.DataPtr);
}


However you would think that email addresses would be easier!
RE: [Request] Custom Contact List Title by Knucks on 01-11-2009 at 07:22 PM

Thanks guys :D Muchly appreciated :)
I recommend this for people who use Polygamy :P


RE: RE: [Request] Custom Contact List Title by warmth on 01-27-2009 at 12:06 AM

quote:
Originally posted by matty
Javascript code:
function OnEvent_Initialize(bMessengerStart) { OnEvent_ContactListWndCreated(); }
function OnEvent_SigninReady(sEmail) { OnEvent_ContactListWndCreated(); }
function OnEvent_ContactListWndCreated() {
    if (Messenger.ContactListWndHandle === 0) return;
    var lpsz = Interop.Allocate(2*Messenger.MyEmail.length+2);
    lpsz.WriteString(0, Messenger.MyEmail);
    Interop.Call('user32', 'SendMessageW', Messenger.ContactListWndHandle, 0xC /* WM_SETTEXT */, 0, lpsz.DataPtr);
}


Wow I screwed that one up HUGE!

I had ChatListWndCreated not ContactListWndCreated...
for some reason always worked great but now is saying:

code:
El script está iniciándose
El script está cargado y listo
Función llamada: OnEvent_Initialize
Función llamada: OnEvent_ContactListWndCreated
Error: No es válido en el nivel superior del documento.
(código: -2147418113).
       Archivo: main.js. Línea: 5.
La función OnEvent_ContactListWndCreated devolvió un error. Código: -2147352567
Función llamada: OnEvent_SigninReady
Función llamada: OnEvent_ContactListWndCreated
Función llamada: OnEvent_ContactListWndCreated