Shoutbox

Background Window - 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: Background Window (/showthread.php?tid=78771)

Background Window by hadesz on 11-05-2007 at 08:32 PM

Hi All!

is there any event or properti, which can tell if a chat window is in the background or active?


RE: Background Window by Quantum on 11-05-2007 at 09:16 PM

No not really but convo notifier and convo close sometimes work like that. Heres the links:

http://www.msgpluslive.net/scripts/view/115-Convo-Notifier/
http://shoutbox.menthix.net/showthread.php?tid=64418&page=1

I like the second one.

Features:

    * Displays a toast message when someone starts a conversation with you.
    * Displays a toast message when someone adds you to his/her contact list.
    * Displays a toast message when someone removes you from his/her contact list.
    * When you already have a conversation window opened with the remote user, you won't get a toast message.
    * When you click the toast, a conversation window with the remote user will be opened. POSTED FROM THE THREAD


RE: Background Window by vikke on 11-05-2007 at 09:23 PM

You can check: (code not tested)

code:
if(ChatWnd.Handle == GetForegroundWindow())
{
  // Window is on top.
}

function GetForegroundWindow()
{
  return Interop.Call("user32.dll", "GetForegroundWindow");
}


RE: Background Window by hadesz on 11-05-2007 at 09:51 PM

Working thanks


RE: Background Window by RaceProUK on 11-06-2007 at 12:25 AM

While it may work, it's not ideal. Checking the window state for a value may be more reliable.

My MSDN learning fails me right now...