0 out of 1 rated this helpful - Rate this topic

GetVPNConnected function

Applies to: desktop apps only

The GetVPNConnected function launches the Get Connected wizard within the calling application to enable virtual private network (VPN) connectivity.

Syntax

HRESULT WINAPI GetVPNConnected(
  __in      const HWND hwndParent,
  __in      const DWORD dwWizardType,
  __in      const DWORD dwContextFlags,
  __in      const DWORD dwUserFlags,
  __in      const HANDLE hUserContext,
  __in_opt  LPWSTR pszCommandLine
);

Parameters

hwndParent [in]

Handle to the parent window that called this API.

This parameter is optional and can be set to NULL.

dwWizardType [in]

Specifies the style of the Get Connected wizard to be launched.

This parameter is optional and can be set to 0.

ValueMeaning
0x00

Default style.

 

dwContextFlags [in]

A set of context flags that describes wizard behaviors.

This parameter is optional and can be set to 0.

ValueMeaning
0x00

The wizard returns the results synchronously and blocks until this call is complete.

0x1

The wizard returns the results immediately and asynchronously via a Windows event.

 

dwUserFlags [in]

A set of user-defined application-specific flags. These flags are defined and interpreted by the calling application.

This parameter is optional and should be set to 0 by default.

hUserContext [in]

User context handle for the parent application thread.

This parameter is optional and should be set to NULL by default.

pszCommandLine [in, optional]

User command line parameters, if any.

This parameter is optional and can be set to NULL.

The following command-line options are supported:

ValueMeaning
-HideFinishPage

Hide the Finish page of the Get Connected wizard.

-SkipInternetDetection

Do not display the Get Connected wizard page that shows whether or not the user has a working or active Internet connection.

-SkipExistingConnections

Do not display the Get Connected wizard page that shows a list of existing Internet connections. This command-line option is commonly used when creating additional Internet connections after one has been previously established, and to prevent novice users from creating a completely new connection each time they attempt to access the Internet.

 

Return value

If the method succeeds the return value is S_OK.

If the method fails, the return value is one of the standard error codes.

Remarks

This API attempts to connect the current user to a VPN. This process can involve creating a new connection, or repairing an existing one.

Note that while this API might indicate that the user is connected to a VPN, resources within that VPN may remain unavailable due to VPN configuration or infrastructure settings.

To launch a Get Connected wizard for an Internet connection, call the GetInternetConnected API.

To launch a Get Connected wizard for an local network (LAN) connection, call the GetNetworkConnected API.

An import library containing the GetVPNConnected function is not included in the Microsoft Windows Software Development Kit (SDK). Applications must use the GetModuleHandle and GetProcAddress functions to retrieve the function pointer from the corresponding DLL and call this function.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

DLL

Connect.dll

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ