The company also officially released a forward-compatible WebView2 SDK along with production-ready WebView2 Runtime, which can be used in any Win32 C/C++ application, and fully supported across existing Windows versions.
And Microsoft’s move to new set of Windows controls as part of the WinUI 3 libraries is perhaps a sign of its rethinking on how the Windows SDKs should be developed.
What exactly is WebView2?
WebView2 is Microsoft’s Edge new embedded web control, which allows Windows app developer to have access to the latest web technologies in both existing and new applications.
It lets developers combine the agility of developing for the web with the ease of building a native desktop application. And WebView2 is a part of Project Reunion, which makes it available across Win32 and UWP applications, as well as in few different UI stacks.
The WebView2 control employs Microsoft Edge (Chromium) as the rendering engine to display web content in native applications. With WebView2, you can embed web code in different parts of native application, or build an entire native application using a single WebView.
Getting Started with WebView2
The common WebView2 rerequisites include WebView2 Runtime or any Microsoft Edge (Chromium) non-stable channel installed on either Windows 10, Windows 8.1, and Windows 7.
And for creating a single-window win32 app, you should start with a basic desktop project that contains a single main window. You can create a traditional Windows Desktop application (C++) for your sample app, and download the modified sample and get started, by navigating to WebView2 Samples.
But in Visual Studio, you'll need to open WebView2GettingStarted.sln and if you're using an older version of Visual Studio, simply hover on the WebView2GettingStarted project, open the contextual menu (right-click), and select Properties. From the Configuration Properties > General, modify Windows SDK Version and Platform Toolset to use the Win10 SDK and Visual Studio toolset (VS toolset).