VB Code:
  1. Private Declare Function InternetCheckConnection Lib "wininet.dll" Alias "InternetCheckConnectionA" (ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
  2.  
  3. Private Const FLAG_ICC_FORCE_CONNECTION = &H1
  4.  
  5. Private Sub Form_Load()
  6.  
  7.     If InternetCheckConnection("http://www.galahtech.com", FLAG_ICC_FORCE_CONNECTION, 0&) = 0 Then
  8.  
  9.         MsgBox "No internet connection detected...", vbInformation
  10.  
  11.     Else
  12.  
  13.         MsgBox "Internet connection detected...", vbInformation
  14.  
  15.     End If
  16.  
  17. End Sub