asynchronously later outside of this event handler. starting event handler by showing our download dialog via this lambda run We avoid potential reentrancy from running a message loop in the download ICoreWebView2DownloadStartingEventArgs* args) -> HRESULT Selecting `CANCEL` will cancel the download.ĬHECK_FAILURE(m_webView2_4->add_DownloadStarting( Selecting `OK` will save the download to the chosen path. The dialog box displays the default result file path and allows the user to specify a different path. This example hides the default download dialog and shows a dialog box instead. Register a handler for the `DownloadStarting` event. If the event is not handled, downloads complete normally with the default dialog shown. The host can change the visibility of the download dialog using the Handled property. Otherwise, the download is saved to the default path after the event completes, and default download dialog is shown if the host did not choose to hide it. If the host chooses to cancel the download, the download is not saved, no dialog is shown, and the state is changed to COREWEBVIEW2_DOWNLOAD_STATE_INTERRUPTED with interrupt reason COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_USER_CANCELED. The host can choose to cancel a download, change the result file path, and hide the default download dialog. This event is raised when a download has begun, blocking the default download dialog, but not blocking the progress of the download. Public HRESULT add_DownloadStarting( ICoreWebView2DownloadStartingEventHandler * eventHandler, EventRegistrationToken * token) Remove an event handler previously added with add_FrameCreated. Remove an event handler previously added with add_DownloadStarting. Summary MembersĪdd an event handler for the DownloadStarting event. interface ICoreWebView2_4Ī continuation of the ICoreWebView2_3 interface to support FrameCreated and DownloadStarting events. For the latest API reference, see WebView2 API Reference. This reference is no longer being maintained.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |