dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: VB4/32,VB5,VB6
Expertise: Intermediate
Aug 7, 2000

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Check whether the user is working off-line

Internet Explorer offers the possibility to simulate an Internet connection with the off-line mode. If you want to know if off-line mode is on or off you can use InternetQueryOption API.

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

' Return True if the user is working 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
Alberto Falossi
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date