Option Private Module
#If VBA7 Then
#If Win64 Then
Declare PtrSafe Function GetWindowLongA Lib "USER32" Alias "GetWindowLongPtrA" (ByVal hWnd As LongPtr, ByVal nIndex As Long) As LongPtr
Declare PtrSafe Function SetWindowLongA Lib "USER32" Alias "SetWindowLongPtrA" (ByVal hWnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As LongPtr) As LongPtr
#Else
Declare PtrSafe Function GetWindowLongA Lib "USER32" (ByVal hWnd As LongPtr, ByVal nIndex As Long) As LongPtr
Declare Function SetWindowLongA Lib "USER32" (ByVal hwnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As LongPtr) As LongPtr
#End If
Declare PtrSafe Function FindWindowA Lib "USER32" (ByVal lpClassName As String, ByVal lpWindowName 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 lpClassName As String, ByVal lpWindowName As String) As Long
#End If
#If VBA7 And Win64 Then
Dim hwnd As LongPtr
#Else
Dim hwnd As Long
#End If
Sub SansX(USF As UserForm) 'suppr la croix userf avec: FindWindowA/SetWindowLongA/GetWindowLongA
hwnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", "X", "D") & "Frame", USF.Caption)
SetWindowLongA hwnd, -16, GetWindowLongA(hwnd, -16) And &HFFF7FFFF
End Sub