1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| '************************************
Dim found As Boolean = False
Dim NExited As Integer
Dim GO As Boolean
Dim iExplorerInstances As New ShellWindows()
Dim objProcess As System.Diagnostics.Process
Private Sub BW01_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BW01.DoWork
Dim StopLoop As Boolean = False
Do Until StopLoop = True
If iExplorerInstances.Count > 0 Then
OPs.KillProcess("iexplore")
Thread.Sleep(500)
End If
If GO = False Then
LanceEtAttend("iexplore.exe", "www.developpez.net")
Thread.Sleep(4000)
Dim iExplorerInstances As New ShellWindows()
For Each iExplorer As SHDocVw.InternetExplorer In iExplorerInstances
If iExplorer.Name = "Windows Internet Explorer" Then
iExplorer.Navigate("www.lesite.net", &H800)
found = True
Exit For
End If
Next
GO = True
'' Attendre jusqu'à ce que le processus rencontre un code de sortie
objProcess.WaitForExit()
'' Libérer les ressources associées au processus
objProcess.Close()
'' Incrémenter la variable qui compte le nombre de fois que IE a été fermer/terminé
NExited += 1
Me.BeginInvoke(New ProgClosedDelegete(AddressOf ProgClosed))
End If
GO = False
Thread.Sleep(1000)
Loop
End Sub
'************************************ |
Partager