Shoutbox

a bit difficult script action - 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: a bit difficult script action (/showthread.php?tid=80806)

a bit difficult script action by airali on 01-08-2008 at 09:09 PM

Hello!
I'm new to the world of scripting with msgplus!
I was wondering if it's possible to make a script that changes the focus to a particular window when a message from a user is received.

I'm talking about tabbed chats!
I'd like to make a script which changes the focus to the window in which I've received the message, when it occurs!

How may i do this?


RE: a bit difficult script action by pollolibredegrasa on 01-08-2008 at 09:24 PM

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin, Message,MessageKind){
     Interop.Call('user32', 'SetFocus', ChatWnd.Handle);
}

Take note though that when using this, if you are in the middle of typing you will continue typing in the new window, and may end up sending the message to the wrong person.

Hope this helps :)