Microsoft Windows CE 3.0  

InternetSetStatusCallback

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function sets up a callback function that Windows CE Internet functions can call as progress is made during an operation.

INTERNET_STATUS_CALLBACK WINAPI
InternetSetStatusCallback(
HINTERNET
hInternet
,
INTERNET_STATUS_CALLBACK
lpfnInternetCallback
);

Parameters

hInternet
Handle for which the callback is to be set.
lpfnInternetCallback
Long pointer to the callback function to call when progress is made, or to return NULL to remove the existing callback function. For more information about the callback function, see INTERNET_STATUS_CALLBACK.

Return Values

The previously defined status callback function indicates success. NULL indicates that there was no previously defined status callback function. INTERNET_INVALID_STATUS_CALLBACK indicates that the callback function is not valid.

Windows CE Remarks

The Windows CE InternetSetStatusCallbacksupports most features of the corresponding Win32 Internet function. The new status callback is exchanged with the old status callback. An application uses the callback function to indicate the progress of synchronous and asynchronous functions and to indicate the completion of an asynchronous request. In Windows CE only InternetReadFileand InternetQueryDataAvailablesupport asynchronous operations.

The status callback is used to indicate status to the application. The asynchronous request completion status is only supported for the functions with asynchronous completion: InternetReadFileand InternetQueryDataAvailable.

Remarks

Both synchronous and asynchronous functions use the callback function to indicate the progress of the request, such as resolving a name, connecting to a server, and so on. The callback function is required for an asynchronous operation. The asynchronous request will call back to the application with INTERNET_STATUS_REQUEST_COMPLETE to indicate the request has been completed.

A callback function can be set on any handle, and is inherited by derived handles. A callback function can be changed using InternetSetStatusCallback, providing there are no pending requests that need to use the previous callback value. Note, however, that changing the callback function on a handle does not change the callbacks on derived handles, such as that returned by InternetConnect. You must change the callback function at each level.

Many of the Win32 Internet functions perform several operations on the network. Each operation can take time to complete, and each can fail.

It is sometimes desirable to display status information during a long-term operation. You can display status information by setting up an Internet status callback function that cannot be removed as long as any callbacks or any asynchronous functions are pending.

After initiating InternetSetStatusCallback, the callback function can be accessed from within any Win32 Internet function for monitoring time-intensive network operations.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Wininet.h   Wininet.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

InternetConnect, InternetReadFile, InternetQueryDataAvailable, INTERNET_STATUS_CALLBACK