What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Chat Window Focus on Message Received

Chat Window Focus on Message Received
Author: Message:
andrewrc
New Member
*


Posts: 2
Joined: Mar 2010
O.P. Chat Window Focus on Message Received
Okay, I'm pretty new to Messenger Plus! (just discovered it yesterday) and even though I know JavaScript, I don't know JScript.

What I'm trying to do is, whenever a new message is received, bring that chat window to the top.

I know it sounds like it would be annoying, but there's a reason why I want to do that. The problem is, if you have a full-screen remote desktop window open, even though you get alerts in the bottom right of the screen... if you minimize a chat window, and get a message when you're not at your computer, you will have no way to know if you got a message or not unless you manually check. So I want the chat window to have focus when it gets a new message.

In most cases, the person using this script will only be talking to one person at a time, so that's not really an issue.

Here's what I have so far... it's probably a piece of crap script - it doesn't work and I'm not sure what to write.

code:
function OnEvent_Initialize(MessengerStart)
{
}

function OnEvent_ChatWndReceiveMessage(ChatWnd)
{
    BringWindowToTop(ChatWnd);
}

function OnEvent_Uninitialize(MessengerExit)
{
}


Any help would be appreciated!

This post was edited on 03-23-2010 at 02:06 PM by andrewrc.
03-23-2010 02:06 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Chat Window Focus on Message Received
Windows API's are used a bit differently than that.

js code:
function OnEvent_ChatWndReceiveMessage(ChatWnd) {
    Interop.Call('user32', 'BringWindowToTopW', ChatWnd.Handle);
}

This post was edited on 03-23-2010 at 04:39 PM by matty.
03-23-2010 04:38 PM
Profile E-Mail PM Find Quote Report
andrewrc
New Member
*


Posts: 2
Joined: Mar 2010
O.P. RE: Chat Window Focus on Message Received
Thank you! I'll try that.
03-23-2010 06:26 PM
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