PDA

Click to See Complete Forum and Search --> : Question for VB Gurus


dohboy
May 29th, 2001, 05:31 PM
Hi,
I am a Student learning Visual Basic, working on a project, I can do my own research, i just need someone to point me to the right direction. I would really appreciate any help..thx

here is the scenario.

I want to be able to detect a DNS error or when a User launches Internet Explorer and it does not load the page. I have looked into API calls and can detect when Internet Explorer has been launched or can detect when computer is not connected to the net, But No referece yet to any calls on Internet Explorer DLL's so I can poll if Internet Explorer failed to load page.

p.s. remember my app is not launchin IE, it just has to detect if user has launched it and it has failed.

thx

Lethal
May 29th, 2001, 09:33 PM
Add the appropriate API declarations:
Forget who posted this..


Public Function Online() As Boolean
'// If you are online it will return True, otherwise False
Online = InternetGetConnectedState(0&, 0&)
End Function

Public Function ViaLAN() As Boolean
Dim SFlags As Long
Call InternetGetConnectedState(SFlags, 0&) '// return the flags associated with the connection

ViaLAN = SFlags And INTERNET_CONNECTION_LAN '// True if the Sflags has a LAN connection
End Function

Public Function ViaModem() As Boolean
Dim SFlags As Long
Call InternetGetConnectedState(SFlags, 0&) '// return the flags associated with the connection

ViaModem = SFlags And INTERNET_CONNECTION_MODEM '// True if the Sflags has a modem connection
End Function