Check the InternetGetConnectedState API function. It returns a non-zero value when online, and zero when offline.
___
[tt]
Private Declare Function InternetGetConnectedState Lib "wininet.dll" (lpdwFlags As Long, ByVal dwReserved As Long) As Long
Private Sub Form_Load()
If InternetGetConnectedState(ByVal 0, 0) Then
MsgBox "connected"
Else
MsgBox "not connected"
End If
End Sub[/tt]
Be aware that there are some limitations with this call. We held a reasonably in-depth investigation into it in this forum a couple of years ago, but I sadly can't find the relevant thread. Instead, I'll provide this URL which flags some of the limitations
StrongM, I'd be interested in that URL you mentioned, and learning about the limitations as well... thanks for pointing out that there are limitations.
No Dolphins were harmed in the posting of this message... Dolphin Friendly Tuna!
Ever feel like you're banging your head against a tree? I did, so I cut down the tree.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.