bonsoir,
Ça "peut" donner quelque chose comme ça (à vérifier...) :
#If Win64 Then
Declare PtrSafe Function GetWindowLongPtr Lib "user32" Alias "GetWindowLongA" _
(ByVal hwnd As LongPtr, ByVal nIndex As Long) As LongPtr
Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hwnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hwnd As LongPtr) As LongPtr
Sub CACHER_BANDE_BLEUE(USF As UserForm)
Dim hwnd As LongPtr
hwnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", "X", "D") & "Frame", USF.Caption)
SetWindowLongA hwnd, -16, GetWindowLongA(hwnd, -16) And Not &HC00000: DrawMenuBar hwnd
End Sub
#ElseIf Win32 Then
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
Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Sub CACHER_BANDE_BLEUE(USF As UserForm)
Dim hwnd&
hwnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", "X", "D") & "Frame", USF.Caption)
SetWindowLongA hwnd, -16, GetWindowLongA(hwnd, -16) And Not &HC00000: DrawMenuBar hwnd
End Sub
#End If
Ce que je ne sais pas : Est-ce qu'on peut inclure Sub CACHER_BANDE_BLEUE dans ces balises ?
Dans cette Sub le :
USF As UserForm
provoque chez moi une erreur de compilation...
A+