Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionOption Explicit 'InternetGetConnectedStateEx Detecter si une connection a internet est active ou pas Private Declare Function InternetGetConnectedStateEx Lib "wininet.dll" ( _ ByRef lpdwFlags As Long, _ ByVal lpszConnectionName As String, _ ByVal dwNameLen As Integer, _ ByVal dwReserved As Long) As Long 'Variable pour InternetGetConnectedStateEx Private NOMCONNEXION As String * 255 Private REP As Long Private Sub Form_Load() Timer1.Interval = 1000 End Sub Private Sub Timer1_Timer() Dim PROG As String, RET As Long, NOMFAI As String 'Recherche toute les secondes si une connexion est en cours RET = InternetGetConnectedStateEx(RET, NOMCONNEXION, 255, 0) NOMFAI = Left(NOMCONNEXION, InStr(1, NOMCONNEXION, Chr$(0)) - 1) If RET > 0 And REP = 0 Then 'Ici place le lancement de ton programme ex: PROG = Shell("C:\WINDOWS\LeNomDeTonProgramme.EXE", 1) 'REP =1 pour ne pas relancer le prog une seconde fois REP = 1 End If End Sub