66#include < tchar.h>
77#include < wrl.h>
88#include < wil/com.h>
9+ // <IncludeHeader>
910// include WebView2 header
1011#include " WebView2.h"
12+ // </IncludeHeader>
1113
1214using namespace Microsoft ::WRL;
1315
@@ -135,7 +137,7 @@ int CALLBACK WinMain(
135137 // Schedule an async task to navigate to Bing
136138 webview->Navigate (L" https://www.bing.com/" );
137139
138- // <Step4 >
140+ // <NavigationEvents >
139141 // Step 4 - Navigation events
140142 // register an ICoreWebView2NavigationStartingEventHandler to cancel any non-https navigation
141143 EventRegistrationToken token;
@@ -149,9 +151,9 @@ int CALLBACK WinMain(
149151 }
150152 return S_OK;
151153 }).Get (), &token);
152- // <Step4 >
154+ // </NavigationEvents >
153155
154- // <Step5 >
156+ // <Scripting >
155157 // Step 5 - Scripting
156158 // Schedule an async task to add initialization script that freezes the Object object
157159 webview->AddScriptToExecuteOnDocumentCreated (L" Object.freeze(Object);" , nullptr );
@@ -162,9 +164,9 @@ int CALLBACK WinMain(
162164 // doSomethingWithURL(URL);
163165 return S_OK;
164166 }).Get ());
165- // <Step5 >
167+ // </Scripting >
166168
167- // <Step6 >
169+ // <CommunicationHostWeb >
168170 // Step 6 - Communication between host and web content
169171 // Set an event handler for the host to return received message back to the web content
170172 webview->add_WebMessageReceived (Callback<ICoreWebView2WebMessageReceivedEventHandler>(
@@ -175,7 +177,7 @@ int CALLBACK WinMain(
175177 webview->PostWebMessageAsString (message.get ());
176178 return S_OK;
177179 }).Get (), &token);
178- // <Step6 >
180+ // </CommunicationHostWeb >
179181
180182 // Schedule an async task to add initialization script that
181183 // 1) Add an listener to print message from the host
0 commit comments