Freigeben über


interface ICoreWebView2SaveAsUIShowingEventArgs

Note

This reference is no longer being maintained. For the latest API reference, see WebView2 API Reference.

interface ICoreWebView2SaveAsUIShowingEventArgs
  : public IUnknown

The event args for SaveAsUIShowing event.

Summary

Members Descriptions
get_AllowReplace Gets the AllowReplace property.
get_Cancel Gets the Cancel property.
get_ContentMimeType Get the Mime type of content to be saved.
get_Kind Gets the Kind property.
get_SaveAsFilePath Gets the SaveAsFilePath property.
get_SuppressDefaultDialog Gets the SuppressDefaultDialog property.
GetDeferral Returns an ICoreWebView2Deferral object.
put_AllowReplace AllowReplace allows user to control what happens when a file already exists in the file path to which the Save As operation is saving.
put_Cancel Sets the Cancel property.
put_Kind Sets the Kind property to save documents of different kinds.
put_SaveAsFilePath Set the SaveAsFilePath property for Save As.
put_SuppressDefaultDialog Sets the SuppressDefaultDialog property, which indicates whether the system default dialog is suppressed.

Applies to

Product Introduced
WebView2 Win32 1.0.2739.15
WebView2 Win32 Prerelease 1.0.2730

Members

get_AllowReplace

Gets the AllowReplace property.

public HRESULT get_AllowReplace(BOOL * value)

get_Cancel

Gets the Cancel property.

public HRESULT get_Cancel(BOOL * value)

get_ContentMimeType

Get the Mime type of content to be saved.

public HRESULT get_ContentMimeType(LPWSTR * value)

The caller must free the returned string with CoTaskMemFree. See API Conventions.

get_Kind

Gets the Kind property.

public HRESULT get_Kind(COREWEBVIEW2_SAVE_AS_KIND * value)

get_SaveAsFilePath

Gets the SaveAsFilePath property.

public HRESULT get_SaveAsFilePath(LPWSTR * value)

The caller must free the returned string with CoTaskMemFree. See API Conventions.

get_SuppressDefaultDialog

Gets the SuppressDefaultDialog property.

public HRESULT get_SuppressDefaultDialog(BOOL * value)

GetDeferral

Returns an ICoreWebView2Deferral object.

public HRESULT GetDeferral(ICoreWebView2Deferral ** value)

This will defer showing the default Save As dialog and performing the Save As operation.

put_AllowReplace

AllowReplace allows user to control what happens when a file already exists in the file path to which the Save As operation is saving.

public HRESULT put_AllowReplace(BOOL value)

Setting this property to TRUE allows existing files to be replaced. Setting this property to FALSE will not replace existing files and will return COREWEBVIEW2_SAVE_AS_UI_RESULT_FILE_ALREADY_EXISTS.

The default value is FALSE.

put_Cancel

Sets the Cancel property.

public HRESULT put_Cancel(BOOL value)

Set this property to TRUE to cancel the Save As action and prevent the download from starting. ShowSaveAsUI returns COREWEBVIEW2_SAVE_AS_UI_RESULT_CANCELLED in this case. The default value is FALSE.

put_Kind

Sets the Kind property to save documents of different kinds.

public HRESULT put_Kind(COREWEBVIEW2_SAVE_AS_KIND value)

See the COREWEBVIEW2_SAVE_AS_KIND enum for a description of the different options. If the kind is not allowed for the current document, ShowSaveAsUI returns COREWEBVIEW2_SAVE_AS_UI_RESULT_KIND_NOT_SUPPORTED.

The default value is COREWEBVIEW2_SAVE_AS_KIND_DEFAULT.

put_SaveAsFilePath

Set the SaveAsFilePath property for Save As.

public HRESULT put_SaveAsFilePath(LPCWSTR value)

SaveAsFilePath is an absolute path of the location. It includes the file name and extension. If SaveAsFilePath is not valid (for example, the root drive does not exist), Save As is denied and COREWEBVIEW2_SAVE_AS_INVALID_PATH is returned.

If the associated download completes successfully, a target file is saved at this location. If the Kind property is COREWEBVIEW2_SAVE_AS_KIND_COMPLETE, there will be an additional directory with resources files.

The default value is a system suggested path, based on users' local environment.

put_SuppressDefaultDialog

Sets the SuppressDefaultDialog property, which indicates whether the system default dialog is suppressed.

public HRESULT put_SuppressDefaultDialog(BOOL value)

When SuppressDefaultDialog is FALSE, the default Save As dialog is shown and the values assigned through SaveAsFilePath, AllowReplace and Kind are ignored when the event args invoke completed.

Set SuppressDefaultDialog to TRUE to perform a silent Save As. When SuppressDefaultDialog is TRUE, the system dialog is skipped and the SaveAsFilePath, AllowReplace and Kind values are used.

The default value is FALSE.