WinInet Functions

WinInet functions and structures are defined in the WinInet.h header file. HTTP and FTP use several of the same WinInet functions to handle data. These common functions handle tasks consistently, regardless of the protocol they are applied to.

These common WinInet functions can be used to create general-purpose functions that handle tasks for FTP and HTTP. For example, these functions can perform the following HTTP and FTP tasks:

For applications that download multiple files or handle multiple tasks, waiting for each task to complete before moving on to the next task can be extremely inefficient. To avoid waiting, many of the Internet functions provide a way to perform tasks asynchronously. For information on using the Internet functions asynchronously, see the Microsoft Developer Network Web site at http://msdn.microsoft.com/developer/.

The following table shows WinInet functions supported by Windows CE.

Function
Description
InternetCanonicalizeUrl Converts a Uniform Resource Locator (URL) to a canonical form, including conversion of unsafe characters into escape sequences.
InternetCloseHandle Closes a single Internet handle or a subtree of Internet handles.
InternetCombineUrl Combines a base and relative URL into a single canonicalized URL.
InternetConnect Opens an FTP or HTTP session for a specified site.
InternetCrackUrl Parses a URL into its component parts.
InternetCreateUrl Creates a URL from its component parts.
InternetErrorDlg Displays a dialog box for the error passed to the InternetErrorDlg function.
InternetFindNextFile Continues a file search from a previous call to the FtpFindFirstFile function.
InternetGetCookie Retrieves the cookie for the specified URL.
InternetGetLastResponseInfo Retrieves the last Windows CE Internet function error description or server response on the thread calling this function.
InternetLockRequestFile Enables the user to place a lock on the file being used.
InternetOpen Initializes Windows CE Internet functions.
InternetOpenUrl Begins reading a complete FTP or HTTP URL. For a relative URL and a base URL separated by blank spaces, InternetCanonicalizeUrl must be called first.
InternetQueryDataAvailable Queries for the amount of data available.
InternetQueryOption Queries for an Internet option on the specified handle
InternetReadFile Reads data from a handle opened by the FtpOpenFile, FtpFindFirstFile, or HttpOpenRequest functions.
InternetReadFileEx Reads data from a handle opened by the InternetOpenUrl, FtpOpenFile, GopherOpenFile, or HttpOpenRequest functions.
InternetSetCookie Creates a cookie associated with the specified URL.
InternetSetFilePointer Sets a file position for the InternetReadFile function.
InternetSetOption Sets an Internet option.
InternetSetStatusCallback Sets up a callback function that Windows CE Internet functions can use during an operation.
InternetTimeFromSystemTime Formats the time and date.
InternetTimeToSystemTime Converts a HTTP time and date string to a SYSTEMTIME structure.
InternetUnlockRequestFile Unlocks a file that was locked using InternetLockRequestFile.
InternetWriteFile Writes data to an open Internet file.