Javascript code:
var oChatWnds = {};
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage) {
oChatWnds[pChatWnd.Handle] = sMessage;
}
function OnEvent_ChatWndReceiveMessage(pChatWnd, sOrigin, sMessage, nKind) {
if (oChatWnds[pChatWnd.Handle] === sMessage) {
delete oChatWnds[pChatWnd.Handle];
} else {
snarl_notify(sMessage);
}
}
function OnEvent_ContactSignin(sEmail) {
snarl_notify(sEmail+"\nhas just signed in");
}
function OnEvent_ContactSignout(sEmail) {
snarl_notify(sEmail+"\nsigned out");
}
function OnEvent_ChatWndDestroyed(pChatWnd) {
delete oChatWnds[pChatWnd.Handle];
}
function snarl_notify(sMessage) {
new ActiveXObject('WScript.Shell').Exec('C:\\Windows\\snarl_notify.exe snShowMessage 5 "Windows Live Messenger" "'+Message+'" "C:\\Windows\\icon.png"');
}