The wininet.dll also gives us some dialling functions:
The internet dial function is defined as follows:
Declare Function InternetDial _ Lib "wininet.dll" Alias "InternetDialA" _ (ByVal hwndParent As Long, _ ByVal strEntryName As String, _ ByVal dwFlags As Long, _ lpdwConnection As Long, _ ByVal dwReserved As Long) As Long
If the function succeeds, it returns 0&. If it fails the return value may be any of the following: ERROR_INVALID_PARAMETER (87), ERROR_NO_CONNECTION (668) or ERROR_USER_DISCONNECTION (631). The RasErrorHandler function will return a descriptive string for these errors.
Parameters:
The internet hang-up function is defined as follows:
Declare Function InternetHangUp Lib "wininet.dll" _ (ByVal dwConnection As Long, _ ByVal dwReserved As Long) As Long
Parameters:
Note: you can also use RasHangUp function with the connection handle returned from the InternetDial function.
The InternetAutodial function dials the default dial up connection entry. It is defined as follows:
Declare Function InternetAutodial Lib "wininet.dll" _ (ByVal dwFlags As Long, _ ByVal hwndParent As Long) As Long
If the function succeeds, it returns 1 (TRUE) else it returns 0 (FALSE). WARNING: if the user has disabled autodial or has no autodial entry defined, the function may still return 1 even though no connection was established.
Parameters:
The InternetAutodialHangup disconnects the autodial connection
Declare Function InternetAutodialHangup Lib "wininet.dll" _ (ByVal dwReserved As Long) As Long
If the function succeeds, it returns 1 (TRUE) else it returns 0 (FALSE).
Parameters:
See Also: Contents, Introduction, RasDial, RasHangUp, VBRasErrorHandler