Skip to content

Latest commit

 

History

History
106 lines (79 loc) · 4.72 KB

nf-wininet-internetcheckconnectiona.md

File metadata and controls

106 lines (79 loc) · 4.72 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.InternetCheckConnectionA
InternetCheckConnectionA function (wininet.h)
Allows an application to check if a connection to the Internet can be established. (ANSI)
InternetCheckConnectionA
wininet/InternetCheckConnectionA
wininet\internetcheckconnection.htm
wininet
4666e4ee-057e-452d-ac2c-d03321a0073f
12/05/2018
InternetCheckConnection, InternetCheckConnection function [WinINet], InternetCheckConnectionA, InternetCheckConnectionW, _inet_internetcheckconnection_function, wininet.internetcheckconnection, wininet/InternetCheckConnection, wininet/InternetCheckConnectionA, wininet/InternetCheckConnectionW
wininet.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
InternetCheckConnectionW (Unicode) and InternetCheckConnectionA (ANSI)
Wininet.lib
Wininet.dll
Windows
19H1
InternetCheckConnectionA
wininet/InternetCheckConnectionA
c++
APIRef
kbSyntax
DllExport
Wininet.dll
InternetCheckConnection
InternetCheckConnectionA
InternetCheckConnectionW

InternetCheckConnectionA function

-description

[InternetCheckConnection is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use NetworkInformation.GetInternetConnectionProfile or the NLM Interfaces. ]

Allows an application to check if a connection to the Internet can be established.

-parameters

-param lpszUrl [in]

Pointer to a null-terminated string that specifies the URL to use to check the connection. This value can be NULL.

-param dwFlags [in]

Options. FLAG_ICC_FORCE_CONNECTION is the only flag that is currently available. If this flag is set, it forces a connection. A sockets connection is attempted in the following order:

  • If lpszUrl is non-NULL, the host value is extracted from it and used to ping that specific host.
  • If lpszUrl is NULL and there is an entry in the internal server database for the nearest server, the host value is extracted from the entry and used to ping that server.

-param dwReserved [in]

This parameter is reserved and must be 0.

-returns

Returns TRUE if a connection is made successfully, or FALSE otherwise. Use GetLastError to retrieve the error code. ERROR_NOT_CONNECTED is returned by GetLastError if a connection cannot be made or if the sockets database is unconditionally offline.

-remarks

InternetCheckConnection is deprecated. InternetCheckConnection does not work in environments that use a web proxy server to access the Internet. Depending on the environment, use NetworkInformation.GetInternetConnectionProfile or the NLM Interfaces to check for Internet access instead.

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).
 

Note

The wininet.h header defines InternetCheckConnection as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

Enabling Internet Functionality

WinINet Functions