Rubrik: HTML/Internet/Netzwerk · Internet / Browser / IE | VB-Versionen: VB4, VB5, VB6 | 05.04.02 |
Prüfen, ob System global offline ist Mit dieser Funktion prüfen Sie, ob das System global offline geschaltet ist. | ||
Autor: Dieter Otter | Bewertung: | Views: 13.428 |
www.tools4vb.de | System: Win9x, WinNT, Win2k, WinXP, Win7, Win8, Win10, Win11 | Beispielprojekt auf CD |
Mit nachfolgender Funktion lässt sich prüfen, ob das System sich im globalen Offline-Modus befindet. Der Offline-Modus wurde mit dem Internet-Explorer Version 4 eingeführt und soll helfen, Internet-Gebühren zu einzusparen.
Option Explicit ' zunächst die benötigten Deklarationen Private Declare Function InternetQueryOption Lib "wininet" _ Alias "InternetQueryOptionA" ( _ ByVal hInternet As Long, _ ByVal dwOption As Long, _ ByRef lpBuffer As Long, _ ByRef dwBufferLength As Long) As Long Private Const INTERNET_OPTION_CONNECTED_STATE = 50 Private Const INTERNET_STATE_DISCONNECTED_BY_USER = &H10
' Globaler Offline-Modus gestartet? Private Function SystemOffline() As Boolean Dim lState As Long If InternetQueryOption(0, _ INTERNET_OPTION_CONNECTED_STATE, _ lState, Len(lState)) <> 0 Then SystemOffline = (lState And _ INTERNET_STATE_DISCONNECTED_BY_USER) End If End Function