interface ICoreWebView2ExperimentalSettings8
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 ICoreWebView2ExperimentalSettings8
: public IUnknown
This is the ICoreWebView2Settings Experimental Interface.
Summary
Members | Descriptions |
---|---|
get_IsNonClientRegionSupportEnabled | The IsNonClientRegionSupportEnabled property enables web pages to use the app-region CSS style. |
put_IsNonClientRegionSupportEnabled | Set the IsNonClientRegionSupportEnabled property. |
Applies to
Product | Introduced |
---|---|
WebView2 Win32 | N/A |
WebView2 Win32 Prerelease |
Members
get_IsNonClientRegionSupportEnabled
The IsNonClientRegionSupportEnabled
property enables web pages to use the app-region
CSS style.
public HRESULT get_IsNonClientRegionSupportEnabled(BOOL * enabled)
Disabling/Enabling the IsNonClientRegionSupportEnabled
takes effect after the next navigation. Defaults to FALSE
.
When this property is TRUE
, then all the non-client region features will be enabled: Draggable Regions will be enabled, they are regions on a webpage that are marked with the CSS attribute app-region: drag/no-drag
. When set to drag
, these regions will be treated like the window's title bar, supporting dragging of the entire WebView and its host app window; the system menu shows upon right click, and a double click will trigger maximizing/restoration of the window size.
When set to FALSE
, all non-client region support will be disabled. The app-region
CSS style will be ignored on web pages.
BOOL nonClientRegionSupportEnabled;
wil::com_ptr<ICoreWebView2ExperimentalSettings8> experimentalSettings;
experimentalSettings = m_settings.try_query<ICoreWebView2ExperimentalSettings8>();
CHECK_FEATURE_RETURN(experimentalSettings);
CHECK_FAILURE(experimentalSettings->get_IsNonClientRegionSupportEnabled(
&nonClientRegionSupportEnabled));
if (nonClientRegionSupportEnabled)
{
CHECK_FAILURE(experimentalSettings->put_IsNonClientRegionSupportEnabled(FALSE));
MessageBox(
nullptr,
L"Non-client region support will be disabled after the next navigation",
L"Settings change", MB_OK);
}
else
{
CHECK_FAILURE(experimentalSettings->put_IsNonClientRegionSupportEnabled(TRUE));
MessageBox(
nullptr,
L"Non-client region support will be enabled after the next navigation",
L"Settings change", MB_OK);
}
put_IsNonClientRegionSupportEnabled
Set the IsNonClientRegionSupportEnabled property.
public HRESULT put_IsNonClientRegionSupportEnabled(BOOL enabled)