You can use InternetGetConnectedState() by including wininet.h and using the following snippet:
<br />#pragma comment(lib,"wininet.lib")<br /> <br />if (InternetGetConnectedState(INTERNET_CONNECTION_LAN | INTERNET_CONNECTION_MODEM,0) == FALSE)<br />{<br /> // Not connected!<br />}<br />else<br />{<br /> // Connected!<br />}<br />
Cheers! :)