WinForms - Remove WS_EX_NOACTIVATE style on initial page Load

- When LoadingStateChanged occurs we remove the ExStyle WS_EX_NOACTIVATE flag
- Previous change to the FocusHandler was reverted in 917480da3b

Updated to match the cefclient example
https://github.com/chromiumembedded/cef/blob/9df4a54308a88fd80c5774d91c62da35afb5fd1b/tests/cefclient/browser/root_window_win.cc#L1088

Resolves #2776
This commit is contained in:
amaitland
2020-04-06 10:48:53 +10:00
parent 917480da3b
commit defc2c3af6
3 changed files with 39 additions and 4 deletions
+13
View File
@@ -45,4 +45,17 @@ namespace CefSharp
SetParent(childHwnd, newParentHwnd);
}
void NativeMethodWrapper::RemoveExNoActivateStyle(IntPtr browserHwnd)
{
HWND hwnd = static_cast<HWND>(browserHwnd.ToPointer());
auto exStyle = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
if (exStyle & WS_EX_NOACTIVATE)
{
//Remove WS_EX_NOACTIVATE
SetWindowLongPtr(hwnd, GWL_EXSTYLE, exStyle & ~WS_EX_NOACTIVATE);
}
}
}