; Return :
; 0x40 INTERNET_CONNECTION_CONFIGURED : Local system has a valid connection To the Internet, but it might Or might not be currently connected.
; 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.
; 0x10 INTERNET_RAS_INSTALLED : Local system has RAS installed
; or 0 if there is no Internet connection
ProcedureDLL CheckInternetConnection()
InternetGetConnectedState_(@Retour, 0)
ProcedureReturn Retour
EndProcedure
;/ Test
State=CheckInternetConnection()
If State=0
Temp.s="No Internet Connection"
EndIf
If State & #INTERNET_CONNECTION_CONFIGURED
Temp="INTERNET_CONNECTION_CONFIGURED"+#CRLF$
EndIf
If State &#INTERNET_CONNECTION_LAN
Temp+"INTERNET_CONNECTION_LAN"+#CRLF$
EndIf
If State &#INTERNET_CONNECTION_MODEM
Temp+"INTERNET_CONNECTION_MODEM"+#CRLF$
EndIf
If State &#INTERNET_CONNECTION_MODEM_BUSY
Temp+"INTERNET_CONNECTION_MODEM_BUSY"+#CRLF$
EndIf
If State &#INTERNET_CONNECTION_OFFLINE
Temp+"INTERNET_CONNECTION_OFFLINE"+#CRLF$
EndIf
If State &#INTERNET_CONNECTION_PROXY
Temp+"INTERNET_CONNECTION_PROXY"+#CRLF$
EndIf
If State &#INTERNET_RAS_INSTALLED
Temp+"INTERNET_RAS_INSTALLED"+#CRLF$
EndIf
MessageRequester("Internet Connexion",Temp)
EDIT: By the way, does RAS mean "Remote Access Server" ? Because the program tells me that I googled about it and it came to be Remote Access Server. Ofcourse I am not reporting a bug, I really have a server
Thanks. (And for what it's worth, it drew attention to the fact the the
Windows Residents file is missing the "INTERNET_*" constants, so I've
just added them for the next PureBasic release).
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.