CEF
is run in it's own message loop, so the standard events don't work.
The first an easiest option is to implement IKeyboardHandler
, you can check the CefSharp
source for a more detailed example (there's one that forwards messages to the parent window if required).
Second run with settings.MultiThreadedMessageLoop = false
, and call Cef.DoMessageLoopWork()
on application idle, this will integrate CEF
into the same message loop as your main application. Again, the source contains examples see https://github.com/cefsharp/CefSharp/blob/cefsharp/49/CefSharp.WinForms.Example/Program.cs#L63
The third option is to hook into the CEF
message loop, see https://github.com/cefsharp/CefSharp/blob/cefsharp/49/CefSharp.WinForms.Example/ChromeWidgetMessageInterceptor.cs for an example
CEF
= Chromium Embedded Framework
- CefSharp
is just a wrapper.