interface ICoreWebView2ExperimentalEnvironment8
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 ICoreWebView2ExperimentalEnvironment8
: public IUnknown
This interface is used to create CreateCoreWebView2ControllerOptions object, which can be passed as a parameter in 'CreateCoreWebView2ControllerWithOptions' and 'CreateCoreWebView2CompositionControllerWithOptions' function for multiple profile support.
Summary
Members | Descriptions |
---|---|
CreateCoreWebView2CompositionControllerWithOptions | Create a new WebView in visual hosting mode with options. |
CreateCoreWebView2ControllerOptions | Create a new ICoreWebView2ExperimentalControllerOptions to be passed as a parameter of CreateCoreWebView2ControllerWithOptions and CreateCoreWebView2CompositionControllerWithOptions. |
CreateCoreWebView2ControllerWithOptions | Create a new WebView with options. |
auto webViewEnvironment8 =
m_webViewEnvironment.try_query<ICoreWebView2ExperimentalEnvironment8>();
if (!webViewEnvironment8)
{
FeatureNotAvailable();
return S_OK;
}
Microsoft::WRL::ComPtr<ICoreWebView2ExperimentalControllerOptions> options;
HRESULT hr = webViewEnvironment8->CreateCoreWebView2ControllerOptions(
m_webviewOption.profile.c_str(), m_webviewOption.isInPrivate, options.GetAddressOf());
if (hr == E_INVALIDARG)
{
ShowFailure(hr, L"Unable to create WebView2 due to an invalid profile name.");
CloseAppWindow();
return S_OK;
}
CHECK_FAILURE(hr);
Applies to
Product | Introduced |
---|---|
WebView2 Win32 | N/A |
WebView2 Win32 Prerelease | 1.0.1018 |
Members
CreateCoreWebView2CompositionControllerWithOptions
Create a new WebView in visual hosting mode with options.
public HRESULT CreateCoreWebView2CompositionControllerWithOptions(HWND parentWindow, ICoreWebView2ExperimentalControllerOptions * options, ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler * handler)
CreateCoreWebView2ControllerOptions
Create a new ICoreWebView2ExperimentalControllerOptions to be passed as a parameter of CreateCoreWebView2ControllerWithOptions and CreateCoreWebView2CompositionControllerWithOptions.
public HRESULT CreateCoreWebView2ControllerOptions(LPCWSTR profileName, BOOL isInPrivateModeEnabled, ICoreWebView2ExperimentalControllerOptions ** options)
CreateCoreWebView2ControllerWithOptions
Create a new WebView with options.
public HRESULT CreateCoreWebView2ControllerWithOptions(HWND parentWindow, ICoreWebView2ExperimentalControllerOptions * options, ICoreWebView2CreateCoreWebView2ControllerCompletedHandler * handler)
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應