interface ICoreWebView2Experimental13
Note
This reference is no longer being maintained. For the latest API reference, see WebView2 API Reference.
Note
This an experimental API that is shipped with our prerelease SDK. See WebView2 release notes.
interface ICoreWebView2Experimental13
: public IUnknown
This is the ICoreWebView2 Experimental Status Bar interface.
Summary
Members | Descriptions |
---|---|
add_StatusBarTextChanged | Add an event handler for the StatusBarTextChanged event. |
get_StatusBarText | |
remove_StatusBarTextChanged | Remove an event handler previously added with add_StatusBarTextChanged . |
Applies to
Product | Introduced |
---|---|
WebView2 Win32 | N/A |
WebView2 Win32 Prerelease | 1.0.1158 |
Members
add_StatusBarTextChanged
Add an event handler for the StatusBarTextChanged
event.
public HRESULT add_StatusBarTextChanged(ICoreWebView2ExperimentalStatusBarTextChangedEventHandler * eventHandler, EventRegistrationToken * token)
StatusBarTextChanged
fires when the WebView is showing a status message, a URL, or an empty string (an indication to hide the status bar).
m_statusBar.Initialize(appWindow);
// Registering a listener for status bar message changes
CHECK_FAILURE(m_webViewExperimental13->add_StatusBarTextChanged(
Microsoft::WRL::Callback<ICoreWebView2ExperimentalStatusBarTextChangedEventHandler>(
[this](ICoreWebView2* sender, IUnknown* args) -> HRESULT {
if (m_customStatusBar)
{
wil::unique_cotaskmem_string value;
Microsoft::WRL::ComPtr<ICoreWebView2Experimental13> wv;
CHECK_FAILURE(sender->QueryInterface(IID_PPV_ARGS(&wv)));
CHECK_FAILURE(wv->get_StatusBarText(&value));
std::wstring valueString = value.get();
if (valueString.length() != 0)
{
m_statusBar.Show(valueString);
}
else
{
m_statusBar.Hide();
}
}
return S_OK;
})
.Get(),
&m_statusBarTextChangedToken));
get_StatusBarText
public HRESULT get_StatusBarText(LPWSTR * value)
remove_StatusBarTextChanged
Remove an event handler previously added with add_StatusBarTextChanged
.
public HRESULT remove_StatusBarTextChanged(EventRegistrationToken token)