interface ICoreWebView2ExperimentalSettings6
Note
This an experimental API that is shipped with our prerelease SDK. See WebView2 release notes.
interface ICoreWebView2ExperimentalSettings6
: public IUnknown
This is an extension of the ICoreWebView2Settings Experimental interface for HiddenPdfToolbarItems.
Summary
Members | Descriptions |
---|---|
get_HiddenPdfToolbarItems | HiddenPdfToolbarItems is used to customize the PDF toolbar items. |
put_HiddenPdfToolbarItems | Set the HiddenPdfToolbarItems property. |
Applies to
Product | Introduced |
---|---|
WebView2 Win32 | N/A |
WebView2 Win32 Prerelease | 1.0.955 |
Members
get_HiddenPdfToolbarItems
HiddenPdfToolbarItems
is used to customize the PDF toolbar items.
public HRESULT get_HiddenPdfToolbarItems(COREWEBVIEW2_PDF_TOOLBAR_ITEMS * hidden_pdf_toolbar_items)
By default, it is COREWEBVIEW2_PDF_TOOLBAR_ITEMS_NONE and so it displays all of the items. Changes to this property apply to all CoreWebView2s in the same environment and using the same profile. Changes to this setting apply only after the next navigation.
wil::com_ptr<ICoreWebView2ExperimentalSettings6> experimentalSettings6;
experimentalSettings6 = m_settings.try_query<ICoreWebView2ExperimentalSettings6>();
CHECK_FEATURE_RETURN(experimentalSettings6);
COREWEBVIEW2_PDF_TOOLBAR_ITEMS hiddenPdfToolbarItems;
CHECK_FAILURE(
experimentalSettings6->get_HiddenPdfToolbarItems(&hiddenPdfToolbarItems));
if (hiddenPdfToolbarItems ==
COREWEBVIEW2_PDF_TOOLBAR_ITEMS::COREWEBVIEW2_PDF_TOOLBAR_ITEMS_NONE)
{
CHECK_FAILURE(experimentalSettings6->put_HiddenPdfToolbarItems(
COREWEBVIEW2_PDF_TOOLBAR_ITEMS::COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PRINT |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS::COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SAVE));
MessageBox(
nullptr,
L"PDF toolbar print and save buttons are hidden after the next navigation.",
L"Settings change", MB_OK);
}
else
{
CHECK_FAILURE(experimentalSettings6->put_HiddenPdfToolbarItems(
COREWEBVIEW2_PDF_TOOLBAR_ITEMS::COREWEBVIEW2_PDF_TOOLBAR_ITEMS_NONE));
MessageBox(
nullptr,
L"PDF toolbar print and save buttons are shown after the next navigation.",
L"Settings change", MB_OK);
}
put_HiddenPdfToolbarItems
Set the HiddenPdfToolbarItems
property.
public HRESULT put_HiddenPdfToolbarItems(COREWEBVIEW2_PDF_TOOLBAR_ITEMS hidden_pdf_toolbar_items)