RE:Activar prog con la conexion
'''para saber si hay alguna conexion activa
Public Declare Function RasHangUp Lib "rasapi32.dll" Alias "RasHangUpA" (ByVal hRasConn As Long) As Long
Public Const RAS_MAXENTRYNAME As Integer = 256
Public Const RAS_MAXDEVICETYPE As Integer = 16
Public Const RAS_MAXDEVICENAME As Integer = 128
Public Const RAS_RASCONNSIZE As Integer = 412
Public Const ERROR_SUCCESS = 0
Public Type RasConn
dwSize As Long
hRasConn As Long
szEntryName(RAS_MAXENTRYNAME) As Byte
szDeviceType(RAS_MAXDEVICETYPE) As Byte
szDeviceName(RAS_MAXDEVICENAME) As Byte
End Type
Private EstadoTransfe As Byte
Declare Function RasEnumConnections Lib "rasapi32.dll" Alias "RasEnumConnectionsA" (lprasconn As Any, lpcb As Long, lpcConnections As Long) As Long
'''''''''''''''''''''''''''''''''
'si rascount hay conexion
Function RASCount() As Integer
Dim lprasconn(0 To 1) As Long ' dummy buffer area
Dim rc As Long ' return code
Dim lpcb As Long ' buffer size
Dim lpcConnections As Long ' connection count
lprasconn(0) = 32 ' each returned item is at least 32 bytes long
lpcb = 0 ' set total number of usable bytes in the buffer to zero
rc = RasEnumConnections(lprasconn(0), lpcb, lpcConnections)
RASCount = lpcConnections ' return connection count
End Function