Option Explicit
Public Type INTERNET_CONNECTED_INFO
dwConnectedState As Long
dwFlags As Long
End Type
Public Declare Function InternetSetOption Lib "wininet.dll" Alias _
"InternetSetOptionA" (ByVal hInternet As Long, _
ByVal lOption As Long, ByRef sBuffer As Any, _
ByVal lBufferLength As Long) As Integer
' Queries an Internet option on the specified handle
Public Declare Function InternetQueryOption Lib "wininet.dll" Alias _
"InternetQueryOptionA" (ByVal hInternet As Long, _
ByVal lOption As Long, ByRef sBuffer As Any, _
ByRef lBufferLength As Long) As Integer
Public Const INTERNET_OPTION_CONNECTED_STATE = 50
Public Const INTERNET_STATE_CONNECTED = 1
' // disconnected from network
Public Const INTERNET_STATE_DISCONNECTED = 2
' 0x00000010 // disconnected by user request
Public Const INTERNET_STATE_DISCONNECTED_BY_USER = &H10
'// no network requests being made (by Wininet)
Public Const INTERNET_STATE_IDLE = &H100
'// network requests being made (by Wininet)
Public Const INTERNET_STATE_BUSY = &H200
'//
'// ISO_FORCE_DISCONNECTED -
'// if set when putting Wininet into disconnected mode,
'// all outstanding requests will be aborted with a cancelled error
'//
Public Const ISO_FORCE_DISCONNECTED = 1