MCPcopy Create free account
hub / github.com/MicrosoftEdge/WebView2Samples / GetMatchCount

Method GetMatchCount

SampleApps/WebView2APISample/AppWindow.cpp:1501–1514  ·  view source on GitHub ↗

[MatchCount]

Source from the content-addressed store, hash-verified

1499
1500//! [MatchCount]
1501bool AppWindow::GetMatchCount()
1502{
1503 auto webView2_28 = m_webView.try_query<ICoreWebView2_28>();
1504 CHECK_FEATURE_RETURN(webView2_28);
1505 wil::com_ptr<ICoreWebView2Find> webView2find;
1506 CHECK_FAILURE(webView2_28->get_Find(&webView2find));
1507 int32_t matchCount;
1508 CHECK_FAILURE(webView2find->get_MatchCount(&matchCount));
1509
1510 std::wstring matchCountStr = L"Match Count: " + std::to_wstring(matchCount);
1511 MessageBox(m_mainWindow, matchCountStr.c_str(), L"Find Operation", MB_OK);
1512
1513 return true;
1514}
1515//! [MatchCount]
1516
1517//! [ActiveMatchIndex]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected