WebBrowserExtensions.DestroyWindow Method (original) (raw)

WebBrowserExtensionsDestroyWindow Method

Version 118.6.80

Manually call https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-destroywindow passing in the handle returned from GetWindowHandle. This method can be used to manually close the underlying CefBrowser instance. This will avoid the WM_Close message that CEF sends by default to the top level window. (Which closes your application). This method should generally only be used in the WinForms version.

Namespace: CefSharp.WinForms
Assembly: CefSharp.WinForms (in CefSharp.WinForms.dll) Version: 118.6.80.0 (118.6.80.0)

Syntax

Examples

Cef.UIThreadTaskFactory.StartNew(() => { var closed = chromiumWebBrowser.DestroyWindow(); });

See Also

Reference