Detection du lancement d'internet explorer

Brahim - 20 mars 2001 à 11:33
 ShadeBob - 23 mars 2001 à 10:30
Bonjour,
J'aimerais savoir comment detecter
qu 'une instance d'internet explorer à ete lancée
Merci.
A voir également:

1 réponse

Salut

En utilisant l'API win 32 comme ceci :

d'abord tu declares dans un mod
Public Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long

Public Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long

Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long

Public Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long

Public Const GW_HWNDFIRST = 0
Public Const GW_HWNDNEXT = 2

Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

CurrWnd = GetWindow(tafenetre.hwnd,GW_HWNDFIRST)

While CurrWnd <> 0
Parent = GetParent(CurrWnd)
Length = GetWindowTextLength(CurrWnd)
NomTache = Space$(Length + 1)
Length = GetWindowText(CurrWnd, NomTache, Length + 1)
NomTache = Left$(NomTache, Len(NomTache) - 1)
If Length <> 0 Then
If NomTache <> tafenetre.Caption And NomTache <> "" Then
If IsWindowVisible(CurrWnd) Then

taille_tache=len(nom_tache)
if mid (nom_tache,taille_tache-18)="Internet Explorer" then
msgbox ("Internet explorer lance")
end if
End If
End If
End If

CurrWnd = GetWindow(CurrWnd, GW_HWNDNEXT)
DoEvents
Wend

j'espere que ca t'ira...

A++
ShadeBob
0
Rejoignez-nous