From cc49948a595c22eb4824ad3958c06a4a8674dbb2 Mon Sep 17 00:00:00 2001 From: Yeechan Lu Date: Thu, 30 Jan 2014 01:02:49 +0800 Subject: [PATCH] Fix: Prevent user from closing the main window via Alt+F4 --- Wox/MainWindow.xaml.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Wox/MainWindow.xaml.cs b/Wox/MainWindow.xaml.cs index 1327c87c1b..75e4bad97f 100644 --- a/Wox/MainWindow.xaml.cs +++ b/Wox/MainWindow.xaml.cs @@ -51,6 +51,13 @@ namespace Wox { SetTheme(CommonStorage.Instance.UserSetting.Theme = "Default"); } + + this.Closing += MainWindow_Closing; + } + + void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) + { + e.Cancel = true; } private void WakeupApp()