Bonjour,
Je télécharge des fichiers.
Sous vba mon code "tourne" sans problème.
Transposer en vb6 je peux récupérer la fenêtre parent, mais pas celles des enfants, voila mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, _ ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Dim hparent, hChild, i, j, Nblign, LCOUR, LDEP As Long
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 C = DateAdd("S", 60, Now) Do While C > Now hparent = FindWindow(vbNullString, "Téléchargement de fichiers") 'FENETRE PARENT If hparent <> 0 Then GoTo cok1 Loop Stop ' erreur telechargement cok1: Sleep 2000 hChild = FindWindowEx(hparent, 0, 0, 0) While hChild wText = Space(256) j = SendMessage(hChild, WM_GETTEXT, 255, wText) wText = Left(wText, j) If wText = "En®istrer" Then GoTo cok2 hChild = FindWindowEx(hparent, hChild, 0, 0) ' get next sibling of hChild Wend Stop 'erreur bouton inexistant
'erreur bouton inexistant
Où est l'erreur?
Merci
Partager