Skip to content

Latest commit

 

History

History
102 lines (74 loc) · 4.93 KB

nf-wininet-internetsetstatuscallback.md

File metadata and controls

102 lines (74 loc) · 4.93 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:wininet.InternetSetStatusCallback
InternetSetStatusCallback function (wininet.h)
Sets up a callback function that WinINet functions can call as progress is made during an operation.
InternetSetStatusCallback
InternetSetStatusCallback function [WinINet]
_inet_internetsetstatuscallback_function
wininet.internetsetstatuscallback
wininet/InternetSetStatusCallback
wininet\internetsetstatuscallback.htm
wininet
fe15627b-c77b-45c0-8ff6-02faa8512b57
12/05/2018
InternetSetStatusCallback, InternetSetStatusCallback function [WinINet], _inet_internetsetstatuscallback_function, wininet.internetsetstatuscallback, wininet/InternetSetStatusCallback
wininet.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Wininet.lib
Wininet.dll
Windows
19H1
InternetSetStatusCallback
wininet/InternetSetStatusCallback
c++
APIRef
kbSyntax
DllExport
Wininet.dll
InternetSetStatusCallback

InternetSetStatusCallback function

-description

The InternetSetStatusCallback function sets up a callback function that WinINet functions can call as progress is made during an operation.

-parameters

-param hInternet [in]

The handle for which the callback is set.

-param lpfnInternetCallback [in]

A pointer to the callback function to call when progress is made, or NULL to remove the existing callback function. For more information about the callback function, see InternetStatusCallback.

-returns

Returns the previously defined status callback function if successful, NULL if there was no previously defined status callback function, or INTERNET_INVALID_STATUS_CALLBACK if the callback function is not valid.

-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 WinINet 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 WinINet function for monitoring time-intensive network operations.

Note  The callback function specified in the lpfnInternetCallback parameter will not be called on asynchronous operations for the request handle when the dwContext parameter of HttpOpenRequest is set to zero (INTERNET_NO_CALLBACK), or the connection handle when the dwContext handle of InternetConnect is set to zero (INTERNET_NO_CALLBACK).

Like all other aspects of the WinINet API, this function cannot be safely called from within DllMain or the constructors and destructors of global objects.

Note  WinINet does not support server implementations. In addition, it should not be used from a service. For server implementations or services use Microsoft Windows HTTP Services (WinHTTP).
 

-see-also

Common Functions

InternetStatusCallback

WinINet Functions