Function Reference


_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]] )

Parameters

$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.

Return Value

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.

Remarks

This function requires Windows Vista or later.

Example

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

If Number(_WinAPI_GetVersion()) < 6.0 Then
        MsgBox(($MB_ICONERROR + $MB_SYSTEMMODAL), 'Error', 'Require Windows Vista or later.')
        Exit
EndIf

If _WinAPI_IsInternetConnected() Then
        ConsoleWrite('Internet is already connected.' & @CRLF)
        Exit
EndIf

; Launch the Get Connected wizard within the calling application to enable Internet connectivity
_WinAPI_GetConnectedDlg(1, 1 + 4)