What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » active window

active window
Author: Message:
Gareth_2007
Junior Member
**


Posts: 21
Joined: Mar 2007
O.P. active window
hey how do i grab the the messenge i have just been sent in the active window? so merlin will only read the messege in the avtive chat window

i have tryed

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message){
    var MyChatName = Messenger.MyName;
    var msg = Message;
   
    if ( ChatWnd != Active ) {
     if ( Origin != MyChatName ) {
        merlin.Show();
        merlin.Play("GetAttention");
        merlin.Play("GetAttentionReturn");
        merlin.Play("RestPose");
        merlin.Speak( Origin + " just said " + msg );
        }

any ideas? cheers

This post was edited on 03-08-2007 at 01:07 AM by Gareth_2007.
03-08-2007 12:37 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: active window
code:
function OnEvent_ChatWndReceiveMessage(oChatWnd, sOrigin, sMessage){
    var _active_window = Interop.Call('user32', 'GetForegroundWindow');

    if (oChatWnd.Handle === _active_window){
        if (sOrigin !== Messenger.MyName){
            merlin.Show();
            merlin.Play("GetAttention");
            merlin.Play("GetAttentionReturn");
            merlin.Play("RestPose");
            merlin.Speak(sOrigin + " says:" + nMessage);
        }
    }
}
03-08-2007 07:02 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On