Search code examples
delphiwebviewmicrosoft-edgec++buildertedgebrowser

Using WebView (EdgeHTML) in Delphi / C++ Builder


Am I understanding correctly that EdgeHTML is now available to desktop (Win32/Win64 applications) now in Windows 10? According to these blog posts:

https://blogs.windows.com/msedgedev/2018/05/09/modern-webview-winforms-wpf-apps/ https://blogs.windows.com/msedgedev/2018/10/04/edgehtml-18-october-2018-update/ https://learn.microsoft.com/en-us/windows/communitytoolkit/controls/wpf-winforms/webview

It appears that Microsoft has added EdgeHTML WebViewControl for Windows desktop (Win32) apps which hasn't been available for desktop apps so far (only Trident based MSHTML control was available for desktop apps).

If this is true, is there a possibility to utilize this in Delphi/C++ Builder or do we have to wait for a new TWebView control in the new update of RAD Studio? If possible - are there any code samples to look at (C++ Builder or Delphi that is)? And does the requirement of .NET means it can't be utilized in regular Win32/Win64 app as produced by RAD Studio?


Solution

  • RAD Studio 10.4 Sydney comes with enhanced support for the new Chromium-based Edge browser by Microsoft.

    There is both a new Control TEdgeBrowser that can be used to use the Edge browser engine directly as well as the possibility to allow the classic TWebBrowser control to use the new Edge rendering engine automatically when it is available via the TWebBrowser.SelectedEngine property.

    Detailed explanation in this blog entry by Embarcadero:

    The API for the Edge WebView Control is extended regularly. The Delphi component will not provide access to the newer functions. In order to use newer functions, follow the steps in Marcodor's answer at WebView2 (TEdgeBrowser) updated Delphi interface (e.g. ICoreWebView2Controller2).