How to find Internet Connection Status ?
http://www.autohotke...p?p=60892#60892
Function ConnectedToInternet( Flag )0x40 INTERNET_CONNECTION_CONFIGURED - Local system has a valid connection to the Internet, but not be currently connected.ConnectedToInternet() should work with all Windows OS.
0x02 INTERNET_CONNECTION_LAN - Local system uses a local area network to connect to the Internet.
0x01 INTERNET_CONNECTION_MODEM - Local system uses a modem to connect to the Internet.
0x08 INTERNET_CONNECTION_MODEM_BUSY - No longer used.
0x20 INTERNET_CONNECTION_OFFLINE - Local system is in offline mode.
0x04 INTERNET_CONNECTION_PROXY - Local system uses a proxy server to connect to the Internet
MSDN Reference: List of WinINet Functions
The Function:ConnectedToInternet(flag=0x40) { Return DllCall("Wininet.dll\InternetGetConnectedState", "Str", flag,"Int",0) }Copy-Paste-Try Example:If ConnectedToInternet() Msgbox, 64, WinInet.dll, ONLINE! else Msgbox, 48, WinInet.dll, OFFLINE! Return ConnectedToInternet(flag=0x40) { Return DllCall("Wininet.dll\InternetGetConnectedState", "Str", flag,"Int",0) }
Credits:
Thanks to Jon for his Post @ How to deal with dllcall returning boolean TRUE/FALSE? ( jordi )
Thanks to Chris for his Post @ the same topic suggesting corrections.
Edit : 07-Oct-2006
Here is an another method using an URL to ascertain Internet Connected Status :URL := "http://www.autohotkey.com" If InternetCheckConnection(URL) Msgbox, 64, WinInet.dll [%URL%], Connection Success! else Msgbox, 48, WinInet.dll [%URL%], Connection Failed! Return ; The Function InternetCheckConnection(Url="",FIFC=1) { Return DllCall("Wininet.dll\InternetCheckConnectionA", Str,Url, Int,FIFC, Int,0) }
Reference: Request by meter @ Help with Wininet.dll\InternetCheckConnection