'patricktoulon exceldownload
#If vba7 Then
'trouver le handle
Private Declare ptrsafe Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Longptr
'on redessine la barre sinon elle se retrouve en bas de l'userform
Private Declare ptrsafe Function DrawMenuBar Lib "user32" (ByVal hwnd As Longptr) As Long
'afficher le userform 1 mode fenetre ,2 mode reduit , 3 plein ecran
Private Declare ptrsafe Function "ShowWindow" Lib "user32" (ByVal hwnd As Longptr, ByVal nCmdShow As Long) As Long
'application des modification
Private Declare ptrsafe Function SetWindowLongA Lib "user32" (ByVal hwnd As Longptr, ByVal nIndex As Long...
#If win64 Then '64 bits
Private Declare PtrSafe Function FWD Lib "user32" Alias "FindWindowA" (ByVal IpClassNAme As String, ByVal IpWindowName As String) As Long
Private Declare PtrSafe Function SWL Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
#Else
'32 bits
Private Declare Function FWD Lib "user32" Alias "FindWindowA" (ByVal IpClassNAme As String, ByVal IpWindowName As String) As Long
Private Declare Function SWL Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
#End If
Private Sub UserForm_Activate()
Dim HANDLE1
HANDLE = FWD(vbNullString, Me.Caption)
SWL HANDLE, -16, &H94CF0080
End Sub
'patricktoulon exceldownload
#If vba7 Then
Dim handle As longptr
#Else
'trouver le handle
Private Declare Function fwa Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
'on redessine la barre sinon elle se retrouve en bas de l'userform
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
'afficher le userform 1 mode fenetre ,2 mode reduit , 3 plein ecran
Private Declare Function showw Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
'application des modification
Private Declare Function SetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Dim handle
#End If
Private Sub Label1_Click()
Unload Me
End Sub
Private Sub Label2_Click()
With Label1
If .Tag <> "3" Then .Tag = "3" Else .Tag = "1"
handle = fwa(vbNullString, Me.Caption)
showw handle, Val(.Tag)
End With
End Sub
Private Sub Label3_Click()
handle = fwa(vbNullString, Me.Caption)
showw handle, 2
End Sub
Private Sub UserForm_Activate()
handle = fwa(vbNullString, Me.Caption)
SetWindowLongA handle, -16, &H140F0101 ' sans caption cadre epais coin arrondi et elastique
DrawMenuBar handle
End Sub
Private Sub UserForm_Resize()
Frame1.Width = Me.Width
For Each ctrl In Me.Frame1.Controls
i = i + 1
l = l + ctrl.Width
ctrl.Left = Frame1.Width - l - 10 - (i * 2)
Next
End Sub
#If vba7 Then
'trouver le handle
Private Declare ptrsafe Function fwa Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Longptr
'on redessine la barre sinon elle se retrouve en bas de l'userform
Private Declare ptrsafe Function DrawMenuBar Lib "user32" (ByVal hwnd As Longptr) As Long
'afficher le userform 1 mode fenetre ,2 mode reduit , 3 plein ecran
Private Declare ptrsafe Function showw Lib "user32" Alias "ShowWindow" (ByVal hwnd As Longptr, ByVal nCmdShow As Long) As Long
'application des modification
Private Declare ptrsafe Function SetWindowLongA Lib "user32" (ByVal hwnd As Longptr, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Dim handle As Longptr
#Else
'trouver le handle
Private Declare Function fwa Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
'on redessine la barre sinon elle se retrouve en bas de l'userform
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
'afficher le userform 1 mode fenetre ,2 mode reduit , 3 plein ecran
Private Declare Function showw Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
'application des modification
Private Declare Function SetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Dim handle As Long
#End If
'patricktoulon exceldownload
#If vba7 Then
'trouver le handle
Private Declare ptrsafe Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Longptr
'on redessine la barre sinon elle se retrouve en bas de l'userform
Private Declare ptrsafe Function DrawMenuBar Lib "user32" (ByVal hwnd As Longptr) As Long
'afficher le userform 1 mode fenetre ,2 mode reduit , 3 plein ecran
Private Declare ptrsafe Function "ShowWindow" Lib "user32" (ByVal hwnd As Longptr, ByVal nCmdShow As Long) As Long
'application des modification
Private Declare ptrsafe Function SetWindowLongA Lib "user32" (ByVal hwnd As Longptr, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Dim handle As Longptr
#Else
'trouver le handle
Private Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
'on redessine la barre sinon elle se retrouve en bas de l'userform
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
'afficher le userform 1 mode fenetre ,2 mode reduit , 3 plein ecran
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
'application des modification
Private Declare Function SetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Dim handle As Long
#End If
Private Sub Label1_Click()
Unload Me
End Sub
Private Sub Label2_Click()
With Label1
If .Tag <> "3" Then .Tag = "3" Else .Tag = "1"
handle = FindWindowA(vbNullString, Me.Caption)
ShowWindow handle, Val(.Tag)
End With
End Sub
Private Sub Label3_Click()
handle = FindWindowA(vbNullString, Me.Caption)
showw handle, 2
End Sub
Private Sub UserForm_Activate()
handle = FindWindowA(vbNullString, Me.Caption)
SetWindowLongA handle, -16, &H140F0101 ' sans caption cadre epais coin arrondi et elastique
DrawMenuBar handle
End Sub
Private Sub UserForm_Resize()
Frame1.Width = Me.Width
For Each ctrl In Me.Frame1.Controls
i = i + 1
l = l + ctrl.Width
ctrl.Left = Frame1.Width - l - 10 - (i * 2)
Next
End Sub