Fixed a bug which has been bothering me a bit in the CEF1-based branch: Alt-F4 shouldn't be marked as Handled, since that makes it impossible to shut down the app by pressing Alt-F4...

This commit is contained in:
Per Lundberg
2013-07-30 23:05:31 +03:00
parent 7da4747640
commit 580b8bd83c
+8
View File
@@ -272,6 +272,14 @@ namespace CefSharp.Wpf
break;
}
if (message == (int) WM.SYSKEYDOWN &&
wParam.ToInt32() == KeyInterop.VirtualKeyFromKey(Key.F4))
{
// We don't want CEF to receive this event (and mark it as handled), since that makes it impossible to
// shut down a CefSharp-based app by pressing Alt-F4, which is kind of bad.
return IntPtr.Zero;
}
if (cefBrowserWrapper.SendKeyEvent(message, wParam.ToInt32()))
{
handled = true;