From 8770f5d9589f085917d0be01e5dd7bcd446ad54d Mon Sep 17 00:00:00 2001 From: Brian Lima Date: Sat, 11 Feb 2017 01:52:01 -0200 Subject: [PATCH] Fixing in-home streaming, release 2.3.0 Fixed in-home streaming bug. Code cleanup. --- UWPHook/AppManager.cs | 7 ++++--- UWPHook/GamesWindow.xaml.cs | 13 ++++++++++--- UWPHook/Properties/AssemblyInfo.cs | 4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/UWPHook/AppManager.cs b/UWPHook/AppManager.cs index 2914c72..b833c59 100644 --- a/UWPHook/AppManager.cs +++ b/UWPHook/AppManager.cs @@ -28,15 +28,16 @@ namespace UWPHook try { mgr.ActivateApplication(aumid, null, ActivateOptions.None, out processId); + //Bring the launched app to the foreground, this fixes in-home streaming + id = (int)processId; + BringProcess(); } catch (Exception e) { throw new Exception("Error while trying to launch your app." + Environment.NewLine + e.Message); } - - id = (int)processId; } /// @@ -122,7 +123,7 @@ namespace UWPHook // if iconic, we need to restore the window if (IsIconic(hWnd)) { - ShowWindowAsync(hWnd, 9); + ShowWindowAsync(hWnd, 3); } // bring it to the foreground diff --git a/UWPHook/GamesWindow.xaml.cs b/UWPHook/GamesWindow.xaml.cs index b2c6164..1647996 100644 --- a/UWPHook/GamesWindow.xaml.cs +++ b/UWPHook/GamesWindow.xaml.cs @@ -38,17 +38,24 @@ namespace UWPHook private void Launcher() { + //So, for some reason, Steam is now stopping in-home streaming if the launched app is minimized, so not hiding UWPHook's window is doing the trick for now if (Properties.Settings.Default.StreamMode) { this.Show(); this.WindowStyle = WindowStyle.None; this.WindowState = WindowState.Maximized; - Thread.Sleep(1000); + this.Title = "UWPHook: Streaming a game"; + this.label.Content = "UWPHook is streaming your game, fasten your seatbelts."; + + Thread.Sleep(10000); + } + else + { + this.Title = "UWPHook: Playing a game"; + this.Hide(); } - this.Title = "UWPHook: Playing a game"; //Hide the window so the app is launched seamless making UWPHook run in the background without bothering the user - this.Hide(); string currentLanguage = CultureInfo.CurrentCulture.ToString(); try diff --git a/UWPHook/Properties/AssemblyInfo.cs b/UWPHook/Properties/AssemblyInfo.cs index 16df19c..c6a35ab 100644 --- a/UWPHook/Properties/AssemblyInfo.cs +++ b/UWPHook/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Windows; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.2.1.0")] -[assembly: AssemblyFileVersion("2.2.1.0")] +[assembly: AssemblyVersion("2.3.0.0")] +[assembly: AssemblyFileVersion("2.3.0.0")]