LEGRANVI
Messages postés3Date d'inscriptionsamedi 2 décembre 2000StatutMembreDernière intervention18 juillet 2008
-
18 juil. 2008 à 14:49
Renfield
Messages postés17287Date d'inscriptionmercredi 2 janvier 2002StatutModérateurDernière intervention27 septembre 2021
-
18 juil. 2008 à 16:10
Bonjour,
Je cherche à modifier un ancien programme en V.B 6, d'une personne que je ne peux plus contacter.
Je rencontre un problème lorsque je lance le programme, j'ai un message d'erreur "Erreur d'exécution 424 - Un objet est requis".
Après avoir essayé de comprendre un peu plus le problème, je vois que le programme exploite un API windows car il y a un appel à une fonction microsoft du type :
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Je ne connais rien au API ???
Je pense qu'il doit manquer une référence lié à ces objets mais alors laquelle ???
Si quelqu'un à des infos ou des solutions, je suis preneur.
LEGRANVI
Messages postés3Date d'inscriptionsamedi 2 décembre 2000StatutMembreDernière intervention18 juillet 2008 18 juil. 2008 à 15:15
Public Sub ListeDesTaches()
ReDim TabTaches(0)
CurrWnd = GetWindow(Form1.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 <> "" Then
If IsWindowVisible(CurrWnd) Then
' MsgBox NomTache
If TabTaches(0) <> "" Then ReDim Preserve TabTaches(UBound(TabTaches) + 1)
TabTaches(UBound(TabTaches)) = CurrWnd & "," & NomTache
Form1.List1.AddItem CurrWnd & "," & NomTache
End If
End If
End If
CurrWnd = GetWindow(CurrWnd, GW_HWNDNEXT)
DoEvents
Wend
End Sub