[FZE] Send close signal to Editor when the main app closes (#12510)

This commit is contained in:
Andrey Nekrasov
2021-07-26 17:02:44 +03:00
committed by GitHub
parent 6dfaf6a21c
commit d2e04d46f4
6 changed files with 42 additions and 5 deletions

View File

@@ -80,6 +80,15 @@ namespace FancyZonesEditor
FancyZonesEditorIO = new FancyZonesEditorIO();
Overlay = new Overlay();
MainWindowSettings = new MainWindowSettingsModel();
new Thread(() =>
{
var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, interop.Constants.FZEExitEvent());
if (eventHandle.WaitOne())
{
Environment.Exit(0);
}
}).Start();
}
private void OnStartup(object sender, StartupEventArgs e)

View File

@@ -81,6 +81,7 @@
<Resource Include="images\FancyZonesEditor.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\common\interop\PowerToysInterop.vcxproj" />
<ProjectReference Include="..\..\..\..\common\ManagedCommon\ManagedCommon.csproj" />
<ProjectReference Include="..\..\..\..\common\Microsoft.PowerToys.Common.UI\Microsoft.PowerToys.Common.UI.csproj" />
</ItemGroup>