Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.

WebView2 Sample WinComp

This is a hybrid application built with the Microsoft Edge WebView2 control.

Sample App Snapshot

The WebView2SampleWinComp is an example of an application that embeds a WebView within a Win32 native application. It is built as a Win32 Visual Studio 2019 project and makes use of both C++ and HTML/CSS/JavaScript in the WebView2 environment. It also uses Windows Runtime Composition APIs (also called the Visual layer) to take avantage of the latest Windows 10 UI features and create better look, feel, and functionality in C++ Win32 applications.

The API Sample showcases a selection of WebView2's event handlers and API methods that allow a native Win32 application to directly interact with a WebView and vice versa.

If this is your first time using WebView, we recommend first following the Getting Started guide, which goes over how to create a WebView2 and walks through some basic WebView2 functionality.

To learn more specifics about events and API Handlers in WebView2, you can refer to the WebView2 Reference Documentation.


  • Microsoft Edge (Chromium) installed on a supported OS. Currently we recommend the latest version of the Edge Canary channel.
  • Visual Studio with C++ support installed.
  • Latest pre-release version of our WebView2 SDK, which is included in this project.
  • By default this sample app will use the latest Window 10 SDK version. However, there is an issue with Windows 10 SDK, version 2004 (10.0.19041.0) that will stop this sample app from building. When running into this issue, either install the later version (Windows 10 SDK version 2104 (10.0.20348.0)) or retarget the project to an older version of Windows SDK (Windows 10 SDK, version 1903 (10.0.18362.1)). Windows 10 SDK version 2104 (10.0.20348.0) and Windows 10 SDK, version 1903 (10.0.18362.1) can be downloaded here).

Build the WebView2 Sample WinComp

Clone the repository and open the solution in Visual Studio. WebView2 is already included as a NuGet package* in this project.

  • Clone this repository
  • Open the solution in Visual Studio 2019**
  • Set the target you want to build (Debug/Release, x86/x64/ARM64)
  • Build the project file: WebView2SampleWinComp.vcxproj

That's it! Everything should be ready to just launch the app.

*You can get the WebView2 NugetPackage through the Visual Studio NuGet Package Manager.

**You can also use Visual Studio 2017 by changing the project's Platform Toolset in Project Properties/Configuration properties/General/Platform Toolset. You might also need to change the Windows SDK to the latest version available to you.