#If VBA7 Then
#If Win64 Then
Private Declare PtrSafe Function SetWindowLongPtr Lib "user32" Alias "SetWindowLongPtrA" (ByVal hwnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As LongPtr) As LongPtr
#Else
Private Declare PtrSafe Function SetWindowLongPtr Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As LongPtr) As LongPtr
#End If
Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
#End If
Private Sub CommandButton1_Click()
applique True, False, True
End Sub
Private Sub CommandButton2_Click()
applique False, True, False
End Sub
Sub applique(Optional reduire As Boolean = False, _
Optional agrandir As Boolean = False, _
Optional resizeb As Boolean = False)
Dim H As LongPtr
H = FindWindow(vbNullString, Me.Caption)
SetWindowLongPtr H, -16, &H94C80080 _
Or &H20000 And reduire _
Or &H10000 And agrandir _
Or &H40000 And resizeb
End Sub