[RELEASE] NetfliXBMC - Unofficial Netflix Add-on (Win/OSX/Linux) - Thread 2
this works pretty good:
Code:
Add-Type @"
  using System;
  using System.Runtime.InteropServices;
  public class SFW {
     [DllImport("user32.dll")]
     [return: MarshalAs(UnmanagedType.Bool)]
     public static extern bool SetForegroundWindow(IntPtr hWnd);
  }
"@

$NetflixStreaming = $false
while (1)
{
    Start-Sleep -Seconds 2
    $test = Get-Process -processname netflixbmc_utility*
    if ($NetflixStreaming -eq $true -and $test.id -eq $null)
    {
        $test = Get-Process -processname chrome*
        foreach($proc in $test)
        {
           if ($proc.mainwindowtitle.length -gt 0)
           {
               [SFW]::SetForegroundWindow($proc.mainwindowhandle)# activate it
               [System.Windows.Forms.SendKeys]::SendWait("%{F4}") #send alt F4
           }
        }
        $NetflixStreaming = $false
        $proc = Get-Process -processname kodi*
        if ($proc.id -ne $null)
        {
               [SFW]::SetForegroundWindow($proc.mainwindowhandle)# activate Kodi
        }
    }
    if ($NetflixStreaming -eq $false -and $test.id -ne $null)
    {
        $NetflixStreaming = $true
    }    
}
Reply


Messages In This Thread
Who's Watching is empty? - by RiverBend - 2015-01-08, 18:55
Full-screen mode - by oakertood - 2015-03-29, 01:08
25% - by Mattlock - 2015-07-06, 03:56
RE: [RELEASE] NetfliXBMC - Unofficial Netflix Add-on (Win/OSX/Linux) - Thread 2 - by Sleuth255 - 2015-08-17, 22:39
Additional/Original Browser Option? - by durv - 2015-09-07, 05:07
[RELEASE] NetfliXBMC - EMPTY LISTS - by Nibar - 2015-12-08, 03:38
Logout Mark Read Team Forum Stats Members Help
[RELEASE] NetfliXBMC - Unofficial Netflix Add-on (Win/OSX/Linux) - Thread 217