Postup:
V modulu deklarujte:
Const INTERNET_OPTION_CONNECTED_STATE
= 50
Const INTERNET_STATE_DISCONNECTED_BY_USER = &H10
Private Type INTERNET_CONNECTED_INFO
dwConnectedState As Long
dwFlags As Long
End Type
Private Declare Function InternetQueryOption Lib "wininet.dll"
Alias _
"InternetQueryOptionA" (ByVal hInternet As Long,
ByVal dwOption _
As Long, lpBuffer As INTERNET_CONNECTED_INFO,
lpdwBufferLength _
As Long) As Boolean
' Tato funkce vrßtφ
True, je-li IE v re₧imu Off-Line
Function IsWorkingOffLine() As Boolean
Dim dwState As Long, dwSize As Long
Dim ci As INTERNET_CONNECTED_INFO
dwState = 0
dwSize = LenB(dwState)
If InternetQueryOption(0&, INTERNET_OPTION_CONNECTED_STATE,
ci, dwSize) Then
IsWorkingOffLine = (ci.dwConnectedState
And _
INTERNET_STATE_DISCONNECTED_BY_USER)
End If
End Function
|