> Private Declare Function InternetGetConnectedState Lib "wininet.dll"
> (ByRef dwflags As Long, ByVal dwReserved As Long) As Long
>
> Public Function IsOnline() As Boolean
> Dim LFlags As Long
> IsOnline = InternetGetConnectedState(LFlags, 0&)
>
> End Function
the return code just tells you if the system HAS an Internet
connection, NOT if such a connection IS active
http://msdn.microsoft.com/en-us/library/windows/desktop/aa384702%28v=vs.85%29.aspx
so, as I wrote in another post here, you'd better mix the above call
with an "InternetAttemptConnect()" one; basically the idea is
Call "InternetGetConnectedState" to check if the system HAS an internet
connection (check the returned flags to verify that, not just the call
result code); if not, just return false, otherwise, if the system HAS
an internet connection, try calling "InternetAttemptConnect" the latter
will either return immediately with a "true" if the internet connection
is active or, if not, will attempt establishing an internet connection;
if the call will fail, again, return a "not connected", otherwise just
use the "InternetGetConnectedState" again to check how the system is
connected and this time, return your result