I migrated from CEF to WebView2 to render in-game overlays for better stability and performance. By default, you can't use WebView2 to render overlay using d3d11, but you can workaround this using https://gist.github.com/pabloko/5b5bfb71ac52d20dfad714c666a0c428
But here's a problem - when you click on the overlay html content, child window (Chrome_WidgetWin_0) will steal focus from main window,
and all your keyboard input will be received by Chrome_WidgetWin_0 window, that means your main window WndProc won't be able to receive
WM_KEYDOWN, WM_SYSKEYDOWN, etc while Chrome_WidgetWin_0 window have focus. To workaround this too, you can use my method below:
- In browser creation code edit:
HRESULT __stdcall EdgeBrowser::Invoke(HRESULT errorCode, ICoreWebView2CompositionController *_comp) {