mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 20:57:22 +02:00
[Shortcut Guide] Move into separate process (#11359)
This commit is contained in:
@@ -28,13 +28,6 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views
|
||||
ColorPickerSharedEventCallback = implementation;
|
||||
}
|
||||
|
||||
public static Func<string> ShortcutGuideSharedEventCallback { get; set; }
|
||||
|
||||
public static void SetShortcutGuideSharedEventCallback(Func<string> implementation)
|
||||
{
|
||||
ShortcutGuideSharedEventCallback = implementation;
|
||||
}
|
||||
|
||||
public static Action<Type> OpenMainWindowCallback { get; set; }
|
||||
|
||||
public static void SetOpenMainWindowCallback(Action<Type> implementation)
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using Microsoft.PowerToys.Settings.UI.OOBE.Enums;
|
||||
using Microsoft.PowerToys.Settings.UI.OOBE.ViewModel;
|
||||
@@ -27,12 +30,12 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views
|
||||
|
||||
private void Start_ShortcutGuide_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
if (OobeShellPage.ShortcutGuideSharedEventCallback != null)
|
||||
var executablePath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, @"..\modules\ShortcutGuide\ShortcutGuide\PowerToys.ShortcutGuide.exe");
|
||||
var id = Process.GetCurrentProcess().Id.ToString(CultureInfo.InvariantCulture);
|
||||
var p = Process.Start(executablePath, id);
|
||||
if (p != null)
|
||||
{
|
||||
using (var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, OobeShellPage.ShortcutGuideSharedEventCallback()))
|
||||
{
|
||||
eventHandle.Set();
|
||||
}
|
||||
p.Close();
|
||||
}
|
||||
|
||||
ViewModel.LogRunningModuleEvent();
|
||||
|
||||
Reference in New Issue
Block a user