matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: 2009, change window colors of conversations
You can still do it.
js code: var oDirectUIDefaultColour = 0x891C;
var oDirectUIStatusColour9 = {
1 : oDirectUIDefaultColour+11, // offline
3 : oDirectUIDefaultColour+10, // online
4 : oDirectUIDefaultColour+5, // busy
5 : oDirectUIDefaultColour+4, // away
6 : oDirectUIDefaultColour+4, // away
7 : oDirectUIDefaultColour+4, // away
8 : oDirectUIDefaultColour+5, // busy
9 : oDirectUIDefaultColour+4 // away
}
function OnEvent_Initialize(bMessengerStart) {
OnEvent_SigninReady();
}
function OnEvent_SigninReady(sEmail) {
if (Messenger.MyStatus === 0) return;
for (var oChatWnd = new Enumerator(Messenger.CurrentChats); !oChatWnd.atEnd(); oChatWnd.moveNext()) {
OnEvent_ChatWndCreated(oChatWnd.item());
}
}
function OnEvent_ChatWndCreated(pChatWnd) {
if (pChatWnd.Contacts.Count !== 1) return;
for (var oContact = new Enumerator(pChatWnd.Contacts); !oContact.atEnd(); oContact.moveNext()) {
Interop.Call('user32', 'SendMessageW', pChatWnd.Handle, 0x111 /* WM_COMMAND */, oDirectUIStatusColour9[oContact.item().Status], 0);
}
}
function OnEvent_ChatWndDestroyed(pChatWnd) {
Interop.Call('user32', 'SendMessageW', pChatWnd.Handle, 0x111 /* WM_COMMAND */, oDirectUIDefaultColour, 0);
}
function OnEvent_ContactStatusChange(sEmail, nNewStatus) {
for (var oChatWnd = new Enumerator(Messenger.CurrentChats); !oChatWnd.atEnd(); oChatWnd.moveNext()) {
if (oChatWnd.item().Contacts.GetContact(sEmail) != null) {
Interop.Call('user32', 'SendMessageW', oChatWnd.item().Handle, 0x111 /* WM_COMMAND */, oDirectUIStatusColour9[nNewStatus], 0);
}
}
}
function OnEvent_ContactSignout(sEmail) {
OnEvent_ContactStatusChange(sEmail, 1);
}
function OnEvent_ContactSignin(sEmail) {
OnEvent_ContactStatusChange(sEmail, Messenger.MyContacts.GetContact(sEmail).Status);
}
|
|