I am working in VB 6. I want to display a message in a textbox as "No Internet Connection" when the computer is not connected with internet or got disconnected.
The below code is only useful when your network cable is unplugged but I want something which will show Text7.text = 1 when and the moment I am logging off from my broadband / client.
Private Declare Function InternetCheckConnection Lib "wininet.dll" Alias _
"InternetCheckConnectionA" (ByVal lpszUrl As String, ByVal dwFlags As Long, _
ByVal dwReserved As Long) As Long
Text7.Text = InternetCheckConnection("http://www.google.com/", &H1, 0)