Skip to content

Commit c97fe3e

Browse files
committed
Fix code snippet labels
1 parent 7f06fc2 commit c97fe3e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

GettingStartedGuides/Win32_GettingStarted/HelloWebView.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
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

1214
using 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

Comments
 (0)