Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nf-wininet-internetcheckconnectiona.md #1848

Open
wants to merge 1 commit into
base: docs
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions sdk-api-src/content/wininet/nf-wininet-internetcheckconnectiona.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,32 @@ Returns <b>TRUE</b> if a connection is made successfully, or <b>FALSE</b> otherw
<div> </div>


# Example

The following code demonstrates how to use above api call.

```cpp
#include <iostream>
#include <Windows.h>
#include <wininet.h>
using namespace std;

int main()
{
LPCSTR urlToPing = "https://www.microsoft.com/";
DWORD flag = FLAG_ICC_FORCE_CONNECTION;
DWORD reserved = 0;
bool InternetStatus = InternetCheckConnectionA(urlToPing, flag, reserved);

if (InternetStatus) {
cout << "Internet Connection Available\n";
}
else {
cout<<"No Internet Connection\n";
}
return 0;
}
```


> [!NOTE]
Expand Down