Option Explicit
#If win64 Then
Private Declare ptrsafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Longptr
#Else
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
#End If
Sub Test()
#If win64 Then
Const CapacitéAdressage = 64
#Else
Const CapacitéAdressage = 32
#End If
MsgBox "Sur mon système à capacité d'adressage de " & CapacitéAdressage & " bits," _
& vbLf & "avec l'expression Application.hWnd, le return handle est de type " & TypeName(Application.Hwnd) & "." & vbCrLf & vbCrLf & _
"par contre avec l'api FindWindowA le type est " & TypeName(FindWindow(vbNullString, Application.Caption))
End Sub