foxhound
asked on
how to dial a connection?
i know that i can make the dialind screen appear with this code
Shell "rundll rnaui.dll,RnaDial NAME", vbNormalFocus
but how do u actualyl start it dialing? it shoudln't be hard i think. thanks
Shell "rundll rnaui.dll,RnaDial NAME", vbNormalFocus
but how do u actualyl start it dialing? it shoudln't be hard i think. thanks
To find all the available connections :
Private Const RAS_MaxDeviceType = 16
Private Const RAS95_MaxDeviceName = 128
Private Const RAS95_MaxEntryName = 256
Private Type RASCONN95
'set dwsize to 412
dwSize As Long
hRasConn As Long
szEntryName(RAS95_MaxEntry Name) As Byte
szDeviceType(RAS_MaxDevice Type) As Byte
szDeviceName(RAS95_MaxDevi ceName) As Byte
End Type
Private Type RASENTRYNAME95
'set dwsize to 264
dwSize As Long
szEntryName(RAS95_MaxEntry Name) As Byte
End Type
Private Declare Function RasEnumConnections Lib "RasApi32.DLL" Alias "RasEnumConnectionsA" (lprasconn As Any, lpcb As Long, lpcConnections As Long) As Long
Private Declare Function RasEnumEntries Lib "RasApi32.DLL" Alias "RasEnumEntriesA" (ByVal reserved As String, ByVal lpszPhonebook As String, lprasentryname As Any, lpcb As Long, lpcEntries As Long) As Long
Private Sub Form_Load()
' #VBIDEUtils#************** ********** ********** ********** ********** ******
' * Programmer Name : Waty Thierry
' * Web Site : www.geocities.com/ResearchTriangle/6311/
' * E-Mail : waty.thierry@usa.net
' * Date : 18/10/1999
' * Time : 20:31
' * Module Name : frmConnectInternet
' * Module Filename : Connect.frm
' * Procedure Name : Form_Load
' * Parameters :
' ************************** ********** ********** ********** ********** ****
' * Comments :
' *
' *
' ************************** ********** ********** ********** ********** ****
Dim s As Long, l As Long, ln As Long, a$
ReDim r(255) As RASENTRYNAME95
m_gradient.GradientForm Me
r(0).dwSize = 264
s = 256 * r(0).dwSize
l = RasEnumEntries(vbNullStrin g, vbNullString, r(0), s, ln)
For l = 0 To ln - 1
a$ = StrConv(r(l).szEntryName() , vbUnicode)
lstConnection.AddItem Left$(a$, InStr(a$, Chr$(0)) - 1)
Next
lstConnection.ListIndex = 0
End Sub
Private Const RAS_MaxDeviceType = 16
Private Const RAS95_MaxDeviceName = 128
Private Const RAS95_MaxEntryName = 256
Private Type RASCONN95
'set dwsize to 412
dwSize As Long
hRasConn As Long
szEntryName(RAS95_MaxEntry
szDeviceType(RAS_MaxDevice
szDeviceName(RAS95_MaxDevi
End Type
Private Type RASENTRYNAME95
'set dwsize to 264
dwSize As Long
szEntryName(RAS95_MaxEntry
End Type
Private Declare Function RasEnumConnections Lib "RasApi32.DLL" Alias "RasEnumConnectionsA" (lprasconn As Any, lpcb As Long, lpcConnections As Long) As Long
Private Declare Function RasEnumEntries Lib "RasApi32.DLL" Alias "RasEnumEntriesA" (ByVal reserved As String, ByVal lpszPhonebook As String, lprasentryname As Any, lpcb As Long, lpcEntries As Long) As Long
Private Sub Form_Load()
' #VBIDEUtils#**************
' * Programmer Name : Waty Thierry
' * Web Site : www.geocities.com/ResearchTriangle/6311/
' * E-Mail : waty.thierry@usa.net
' * Date : 18/10/1999
' * Time : 20:31
' * Module Name : frmConnectInternet
' * Module Filename : Connect.frm
' * Procedure Name : Form_Load
' * Parameters :
' **************************
' * Comments :
' *
' *
' **************************
Dim s As Long, l As Long, ln As Long, a$
ReDim r(255) As RASENTRYNAME95
m_gradient.GradientForm Me
r(0).dwSize = 264
s = 256 * r(0).dwSize
l = RasEnumEntries(vbNullStrin
For l = 0 To ln - 1
a$ = StrConv(r(l).szEntryName()
lstConnection.AddItem Left$(a$, InStr(a$, Chr$(0)) - 1)
Next
lstConnection.ListIndex = 0
End Sub
ASKER
i said the i have the code Shell "rundll rnaui.dll,RnaDial NAME", vbNormalFocus in my orginal question but that only display the 'connect' screen, doesnt' actually start dialing. i it possible? thanks
You could simply call:
SendKeys "{ENTER}"
after you call the Shell command..
That would press the enter key, causing the "Connect" button to be pressed.
SendKeys "{ENTER}"
after you call the Shell command..
That would press the enter key, causing the "Connect" button to be pressed.
ASKER
nope, i'll tried that, the enter goes to the form rather than the 'connect' screen, even after i used vbnormalfocus
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks for the points! Glad I could help!
Cheers!
Cheers!
' #VBIDEUtils#**************
' * Programmer Name : Waty Thierry
' * Web Site : www.geocities.com/ResearchTriangle/6311/
' * E-Mail : waty.thierry@usa.net
' * Date : 18/10/1999
' * Time : 20:31
' * Module Name : frmConnectInternet
' * Module Filename : Connect.frm
' * Procedure Name : cmdConnect_Click
' * Parameters :
' **************************
' * Comments :
' *
' *
' **************************
Dim a$
a$ = "rundll rnaui.dll,RnaDial " & lstConnection.List(lstConn
Shell a$, vbNormalFocus
End Sub