Running Dialup Internet Connections Using the IE Connection Dialog
This allows you to be able to setup programs that can connect to the net using the IE connection dialog box. If the 'Never Dial a Connection' option is selected, this code will not be able to connect. It is pretty straight forward to me, but if you need help just email me!
Original Author: Carroll Dearstone
Code
Private Private Private '------------------- Public Public Public Function Function Function '-------------------
'Start Examples of Form Code
'-------------------
Private Sub cmdConnectPopUp_Click()
PopUpConnectDialog
End Sub
Sub cmdConnectAndDial_Click()
PopUpThenDialConnectDialog
End Sub
Sub cmdDisconnect_Click()
HangUpConnection
End Sub
Sub Form_Load()
PopUpThenDialConnectDialog
End Sub
'End Examples of Form Code
'-------------------
'-------------------
'Start Module Code
'-------------------
Declare Function
InternetAutodial Lib "wininet.dll" _
(ByVal dwFlags As Long,
ByVal dwReserved As Long) As Long
Declare Function
InternetAutodialHangup Lib "wininet.dll" _
(ByVal dwReserved As Long)
As Long
Const INTERNET_AUTODIAL_FORCE_ONLINE
= 1
Public Const INTERNET_AUTODIAL_FORCE_UNATTENDED
= 2
PopUpConnectDialog()
On Error Resume Next
If InternetAutodial(INTERNET_AUTODIAL_FORCE_ONLINE,
0) Then
MsgBox "You're Connected!", vbOKOnly, "Your App Name"
End If
End Function
PopUpThenDialConnectDialog()
On Error Resume Next
If InternetAutodial(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0) Then
MsgBox "You're Connected!", vbOKOnly, "Your App Name"
End If
End Function
HangUpConnection()
On Error Resume Next
If InternetAutodialHangup(0) Then
MsgBox "You're Disconnected!", vbOKOnly, "Your App Name"
End If
End Function
'-------------------
'End Module Code
'-------------------
Thanks,
Carroll Dearstone
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.