Funktionreferenz


_WinAPI_GetConnectedDlg


Launches the Get Connected wizard within the calling application to enable network connectivity

#include <WinAPIDlg.au3>
_WinAPI_GetConnectedDlg ( $iDlg [, $iFlags = 0 [, $hParent = 0]] )

Parameter

$iDlg Specifies which the dialog should be launched, valid values:
0 - Local area network connectivity.
1 - Internet connectivity.
2 - Virtual private network (VPN) connectivity.
$iFlags [optional] Specifies an additional options. This parameter can be one or more of the following values.
0 - Default.
1 - Do not display the Get Connected wizard page that shows whether or not the user has a working or active Internet connection.
2 - Do not display the Get Connected wizard page that shows a list of existing internet connections.
4 - Hide the finish page of the Get Connected wizard.
$hParent [optional] Handle to the parent window that called this API.

Rückgabewert

Success: 1 - The Internet is connected.
0 - Otherwise.
Failure: 0 and sets the @error flag to non-zero, @extended flag may contain the HRESULT error code.

Bemerkungen

This function requires Windows Vista or later.

Beispiel

#include <MsgBoxConstants.au3>
#include <WinAPIDiag.au3>
#include <WinAPIDlg.au3>
#include <WinAPISys.au3>

If Number(_WinAPI_GetVersion()) < 6.0 Then
    MsgBox(($MB_ICONERROR + $MB_SYSTEMMODAL), 'Fehler', 'Benötigt Windows Vista oder neuer.')
    Exit
EndIf

If _WinAPI_IsInternetConnected() Then
    ConsoleWrite('Internet ist bereits verbunden.' & @CRLF)
    Exit
EndIf

; Startet den Assistenten "Get Connected" innerhalb der anrufenden Anwendung, um die Internetverbindung zu aktivieren
_WinAPI_GetConnectedDlg(1, 1 + 4)