What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » How to detect fullscreen application?

How to detect fullscreen application?
Author: Message:
V@no
Full Member
***

Avatar
sexy

Posts: 162
Joined: Mar 2004
O.P. How to detect fullscreen application?
Hello!

WLM by itself has compatibility to detect fullscreen application. Can we use that feature in our scripts?
Or is there another way detect it?

So far I could only find Detect Full Screen application topic, I've tried proposed code but it fails: when WMP is in fullscreen, it fails at GetWindowRect check, on PotPlayer it fails at IsIconic.

The code:
Javascript code:
// Check if full screen app is running
function IsFullScreenAppRunning ()
{
  var hWnd = Interop.Call('user32', 'GetForegroundWindow');
 
  if(!hWnd)
  {
    Debug.Trace(1);
    return false;
  }
 
  if(!Interop.Call('user32', 'IsWindowVisible', hWnd) || Interop.Call('user32', 'IsIconic', hWnd) || !Interop.Call('user32', 'IsZoomed', hWnd))
  {
    Debug.Trace(2 + " | " + Interop.Call('user32', 'IsWindowVisible', hWnd) + " | " +Interop.Call('user32', 'IsIconic', hWnd) + " | " +Interop.Call('user32', 'IsZoomed', hWnd));
    return false;
  }
 
  var rc;
 
  if(!Interop.Call('user32', 'GetWindowRect', hWnd, rc))
  {
    Debug.Trace(3);
    return false;
  }
  Debug.Trace(4 + " | " + rc.right + " | " + rc.left + " | " + Interop.Call('user32', 'GetSystemMetrics', SM_CXSCREEN));
  return (rc.right - rc.left  >= Interop.Call('user32', 'GetSystemMetrics', SM_CXSCREEN) &&  rc.bottom - rc.top >= Interop.Call('user32', 'GetSystemMetrics', SM_CYSCREEN));
}


Any help would be appreciated.

Thank you.
11-28-2010 05:25 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
How to detect fullscreen application? - by V@no on 11-28-2010 at 05:25 PM
RE: How to detect fullscreen application? - by Matti on 11-28-2010 at 06:13 PM
RE: RE: How to detect fullscreen application? - by V@no on 11-28-2010 at 08:18 PM
RE: How to detect fullscreen application? - by Matti on 11-28-2010 at 08:52 PM


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