mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 19:25:01 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user