Declare PtrSafe Function cherche_fenetre Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Long, ByVal lpWindowName As Long) As Long
Declare PtrSafe Function get_titre Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare PtrSafe Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Sub tous_les_processus()
Dim titre As String
Columns(1).ClearContents
lin = 0
poign = cherche_fenetre(0, 0)
Do While poign <> 0
titre = String(100, Chr$(0))
get_titre poign, titre, 100
'MsgBox (titre)
titre = Left$(titre, InStr(titre, Chr$(0)) - 1)
If titre <> "" Then
If Right(titre, 4) = ".pdf" Then
lin = lin + 1
Cells(lin, 1).Value = titre
'Cells(lin, 1).Value = Left(titre, InStr(titre, Chr$(0)) - 14)
End If
End If
poign = GetWindow(poign, 2)
Loop
End Sub