Bonjour à vous 2
@ErwannCls, le souci initial vient de la déclaration des API WIndows en mode 32 bits
Pour régler le souci, Joco7915 à fait une déclaration conditionnelle et mis "PtrSafe" et "LongPtr" pour la version 64 bits
' Cette fonctionnalité permet de désactiver la croix de fermeture des formulaires
' LE CODE D'ACTIVATION EST PRÉSENT DANS CHAQUE FORMULAIRE
Option Explicit
#If VBA7 Then
Declare PtrSafe Function GetWindowLongA Lib "user32" (ByVal hwnd As LongPtr, ByVal nIndex As Long) As Long
Declare PtrSafe Function SetWindowLongA Lib "user32" (ByVal hwnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare PtrSafe Function FindWindowA Lib "user32" (ByVal IpClasseName As String, ByVal IpWindowName As String) As LongPtr
#Else
Declare Function GetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function FindWindowA Lib "user32" (ByVal IpClasseName As String, ByVal IpWindowName As String) As Long
#End If
#If VBA7 Then
Public Sub OteCroix(Caption As String)
Dim hwnd As LongPtr
hwnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", "X", "D") & "Frame", Caption)
SetWindowLongA hwnd, -16, GetWindowLongA(hwnd, -16) And &HFFF7FFFF
End Sub
#Else
Public Sub OteCroix(Caption As String)
Dim hwnd As Long
hwnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", "X", "D") & "Frame", Caption)
SetWindowLongA hwnd, -16, GetWindowLongA(hwnd, -16) And &HFFF7FFFF
End Sub
#End If
Sauf que ça ne suffit pas, puisque on as un message dans "Module1_affichage"