WEBVIEW_DOWNLOAD_INFO  
 

The WEBVIEW_DOWNLOAD_INFO structure contains information about the current state of a file download.

typedef struct _WEBVIEW_DOWNLOAD_INFO
{
    DWORD dwSize;
    DWORD dwFileId;
    DWORD dwStatus;
    ULARGE_INTEGER uiBytesTotal;
    ULARGE_INTEGER uiBytesCopied;
    DWORD dwTimeElapsed;
    TCHAR szFileName[260];
    TCHAR szFileUrl[2048];
} WEBVIEW_DOWNLOAD_INFO, *LPWEBVIEW_DOWNLOAD_INFO;

Members

dwSize
Specifies the size of the structure in bytes. This member must be initialized by the caller.
dwFileId
A unique identifier assigned to the download. This value can be used with functions such as WebViewGetDownloadInfo and WebViewCancelDownload to query or manage the download.
dwStatus
Indicates the current state of the download. This will be one of the following values:
Name Description
WEBVIEW_DOWNLOAD_STARTED The file download has started and is in-progress.
WEBVIEW_DOWNLOAD_COMPLETED The file download has completed successfully.
WEBVIEW_DOWNLOAD_CANCELED The file download has been canceled.
WEBVIEW_DOWNLOAD_FAILED The file download failed due to a network error or other problem.
uiBytesTotal
The total size of the file, in bytes, as reported by the server. If the server did not provide the file size, this value may be zero.
uiBytesCopied
The number of bytes that have been downloaded so far. If the download has completed, this value will be equal to uiBytesTotal. If the total size is unknown, this value still reflects the number of bytes received.
dwTimeElapsed
The elapsed time for the download, in milliseconds. For completed downloads this is the total time from start to finish. For active downloads this is the time since the download began. If the download has not started, this value is zero.
szFileName
A null-terminated string which specifies the local file name associated with the download. If the application has not changed the file path using WebViewSetDownloadPath, this will be the default file name assigned by the browser. Typically the file will be stored in the current user's Downloads folder.
szFileUrl
A null-terminated string which specifies the URL of the file being downloaded. This is the fully qualified resource location provided to the browser.

Remarks

This structure provides detailed information about the progress and final state of a download managed by the browser. Before calling a function that populates this structure, such as WebViewGetDownloadInfo, the caller must set the dwSize member to the size of the structure. This ensures that applications remain compatible if new fields are added in future updates.

The uiBytesTotal and uiBytesCopied members allow applications to report download progress or log completed downloads. If the total file size is not known, uiBytesTotal will be zero and applications should base their progress reporting on the number of bytes copied alone.

The dwFileId member can be obtained from WebViewEnumDownloads, and is required to retrieve download information or to cancel a pending download.

Both ANSI (A) and Unicode (W) versions of this structure are provided. Applications that call WebViewGetDownloadInfoW will populate the wide-character members of the structure (such as szFileName and szFileUrl) with UTF-16 encoded text. Applications that call WebViewGetDownloadInfoA will receive the ANSI version of the structure, where those same members are returned as UTF-8 encoded strings. The default WEBVIEW_DOWNLOAD_INFO macro maps to one or the other depending on whether the UNICODE preprocessor symbol is defined at compile time.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h.
Unicode: Implemented as Unicode and ANSI versions

See Also