quote:
Originally posted by cooldude_i06
Interop.Call('User32','BringWindowToTop', objPlusWnd.Handle);
Interop.Call('User32','ShowWindow', objPlusWnd.Handle, 1);
you rock. i'll post the script in a few minutes.
edit: that's still not working.
code:
function OnEvent_Initialize(MessengerStart)
{
}
var toastmsg = '0';
function OnEvent_ChatWndSendMessage(ChatWnd,Message)
{
if(Message == "!toastmsg")
{
if(toastmsg == '0')
{
toastmsg = '1'
MsgPlus.DisplayToast("Toast Message","Toast Message is ON");
}
else
{
toastmsg = '0'
MsgPlus.DisplayToast("Toast Message","Toast Message is OFF");
}
return ""
}
}
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
if (toastmsg=='1')
{
if (Origin != Messenger.MyName)
{
if (Message.length + Origin.length < 90)
{
MsgPlus.DisplayToastContact("Toast Message",Origin + " says:",Message,"","focusIt",ChatWnd.Handle);
}
else
{
var newMsg = Message.substr(0,90 - Origin.length) + "...";
MsgPlus.DisplayToastContact("Toast Message",Origin + " says:",newMsg,"","focusIt",ChatWnd.Handle);
}
}
}
}
function focusIt(which)
{
Interop.Call('User32','BringWindowToTop', which);
Interop.Call('User32','ShowWindow', which, 1);
}
function OnEvent_Uninitialize(MessengerExit)
{
}
that's it so far. /toastmsg replaced with !toastmsg so i don't have to send over a scriptinfo.xml too.
p.s. at first i thought it was a crap idea for a script but now i realise i'd use it often.