|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Member
Iscritto dal: Feb 2001
Città: Reggio Emilia
Messaggi: 230
|
CHUIDERE IEXPLORE DA VB
Come posso chiudere la connessione utilizzando VB ?
|
|
|
|
|
|
#2 | |
|
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
Re: CHUIDERE IEXPLORE DA VB
Quote:
Però chiudere IExplorer credo che sia diverso da chiudere la connessione... |
|
|
|
|
|
|
#3 |
|
Member
Iscritto dal: Feb 2001
Città: Reggio Emilia
Messaggi: 230
|
The CloseWindow function minimizes (but does not destroy) the specified window.
Io vorrei fare da VB quello che faccio con l'icona della connessione in basso a dx del desktop: (stato o disconnetti) |
|
|
|
|
|
#4 | ||
|
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
Quote:
In caso venga ricevuto un WM_CLOSE (che è il emssaggio che invia CloseWindow) allora viene richiamato DestroyWindow che termina l'operazione di chiusura... Comunque si può provare con entrambi... Quote:
Altrimenti bisogna passare da altri lidi...cioè con le librerie RAS... Ecco un esempio : Codice:
Const RAS_MAXENTRYNAME = 256
Const RAS_MAXDEVICETYPE = 16
Const RAS_MAXDEVICENAME = 128
Const RAS_RASCONNSIZE = 412
Private 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 Declare Function RasEnumConnections Lib "rasapi32.dll" Alias "RasEnumConnectionsA" (lpRasConn As Any, lpcb As Long, lpcConnections As Long) As Long
Private Declare Function RasHangUp Lib "rasapi32.dll" Alias "RasHangUpA" (ByVal hRasConn As Long) As Long
Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: [email protected]
'This program will close your Internet-connection, so to test this, you will have to open an Internet-connection.
Dim i As Long, lpRasConn(255) As RasConn, lpcb As Long
Dim lpcConnections As Long, hRasConn As Long
'Set the structure's size
lpRasConn(0).dwSize = RAS_RASCONNSIZE
lpcb = RAS_MAXENTRYNAME * lpRasConn(0).dwSize
lpcConnections = 0
'Enumerate all the available connections
returncode = RasEnumConnections(lpRasConn(0), lpcb, lpcConnections)
If returncode = 0 Then
For i = 0 To lpcConnections - 1
hRasConn = lpRasConn(i).hRasConn
'Hang up
returncode = RasHangUp(ByVal hRasConn)
Next i
End If
End Sub
|
||
|
|
|
|
|
#5 |
|
Member
Iscritto dal: Feb 2001
Città: Reggio Emilia
Messaggi: 230
|
Ci provo. Thanks |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 20:50.



















