ICoreWebView2DownloadOperation

Undocumented in source.

Members

Functions

Cancel
HRESULT Cancel()

Cancels the download. If canceled, the default download dialog shows that the download was canceled. Host should set the Cancel property from ICoreWebView2SDownloadStartingEventArgs if the download should be canceled without displaying the default download dialog.

Pause
HRESULT Pause()

Pauses the download. If paused, the default download dialog shows that the download is paused. No effect if download is already paused. Pausing a download changes the state to COREWEBVIEW2_DOWNLOAD_STATE_INTERRUPTED with InterruptReason set to COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_USER_PAUSED.

Resume
HRESULT Resume()

Resumes a paused download. May also resume a download that was interrupted for another reason, if CanResume returns true. Resuming a download changes the state from COREWEBVIEW2_DOWNLOAD_STATE_INTERRUPTED to COREWEBVIEW2_DOWNLOAD_STATE_IN_PROGRESS.

add_BytesReceivedChanged
HRESULT add_BytesReceivedChanged(ICoreWebView2BytesReceivedChangedEventHandler eventHandler, EventRegistrationToken* token)

Add an event handler for the BytesReceivedChanged event.

add_EstimatedEndTimeChanged
HRESULT add_EstimatedEndTimeChanged(ICoreWebView2EstimatedEndTimeChangedEventHandler eventHandler, EventRegistrationToken* token)

Add an event handler for the EstimatedEndTimeChanged event.

add_StateChanged
HRESULT add_StateChanged(ICoreWebView2StateChangedEventHandler eventHandler, EventRegistrationToken* token)

Add an event handler for the StateChanged event.

get_BytesReceived
HRESULT get_BytesReceived(INT64* bytesReceived)

The number of bytes that have been written to the download file.

get_CanResume
HRESULT get_CanResume(BOOL* canResume)

Returns true if an interrupted download can be resumed. Downloads with the following interrupt reasons may automatically resume without you calling any methods: COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE, COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH, COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT. In these cases download progress may be restarted with BytesReceived reset to 0.

get_ContentDisposition
HRESULT get_ContentDisposition(LPWSTR* contentDisposition)

The Content-Disposition header value from the download's HTTP response.

get_EstimatedEndTime
HRESULT get_EstimatedEndTime(LPWSTR* estimatedEndTime)

The estimated end time in ISO 8601 Date and Time Format.

get_InterruptReason
HRESULT get_InterruptReason(COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON* interruptReason)

The reason why connection with file host was broken.

get_MimeType
HRESULT get_MimeType(LPWSTR* mimeType)

MIME type of the downloaded content.

get_ResultFilePath
HRESULT get_ResultFilePath(LPWSTR* resultFilePath)

The absolute path to the download file, including file name. Host can change this from ICoreWebView2DownloadStartingEventArgs.

get_State
HRESULT get_State(COREWEBVIEW2_DOWNLOAD_STATE* downloadState)

The state of the download. A download can be in progress, interrupted, or completed. See COREWEBVIEW2_DOWNLOAD_STATE for descriptions of states.

get_TotalBytesToReceive
HRESULT get_TotalBytesToReceive(INT64* totalBytesToReceive)

The expected size of the download in total number of bytes based on the HTTP Content-Length header. Returns -1 if the size is unknown.

get_Uri
HRESULT get_Uri(LPWSTR* uri)

The URI of the download.

remove_BytesReceivedChanged
HRESULT remove_BytesReceivedChanged(EventRegistrationToken token)

Remove an event handler previously added with add_BytesReceivedChanged.

remove_EstimatedEndTimeChanged
HRESULT remove_EstimatedEndTimeChanged(EventRegistrationToken token)

Remove an event handler previously added with add_EstimatedEndTimeChanged.

remove_StateChanged
HRESULT remove_StateChanged(EventRegistrationToken token)

Remove an event handler previously added with add_StateChanged.

Meta