matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: [Release]Polygamy addition: Window Named as email
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.
*/
|
|