Hi @chen chen
Welcome to Microsoft Q&A!
Refer to @Viorel 's answer in this thread.
You can define a event_token and use it again in NavigationCompleted
.
event_token event = wv1().CoreWebView2().NavigationCompleted({this, &MainWindow::Wv1_NavigationCompleted });
wv1().CoreWebView2().NavigationCompleted(event);
You can also define boolean to choose whether this handler is required.
bool m_bIsNeededNavigationCompleted = false;
if (m_bIsNeededNavigationCompleted)
{
wv1().CoreWebView2().NavigationCompleted({ this, &MainWindow::Wv1_NavigationCompleted });
}
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.