Option Explicit
Private Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Private Sub UserForm_Initialize()
Dim der As Integer, i As Integer, j As Integer
Dim hwnd As Long, exLong As Long, zFactor As Integer, Style As Long
On Error Resume Next
hwnd = FindWindowA(vbNullString, Me.Caption)
exLong = GetWindowLongA(hwnd, -16)
If exLong And &H880000 Then SetWindowLongA hwnd, -16, exLong And &HFF77FFFF
zFactor = 100 * CInt(Application.Width / Me.Width)
Me.Width = Application.Width
Me.Height = Application.Height
Style = GetWindowLong(hwnd, -16) And Not &HC00000
SetWindowLong hwnd, -16, Style
DrawMenuBar hwnd
End Sub
Ah oui........tout de meme............!!!!! Je ne m'attendais pas à ça!! je pensais que ce serait plus simple que ça comme code!
Merci beaucoup je vais essayer.
Bonjour didierrp, bonjour Said
perso, je vais dans Propriété UsF et je met les dimensions dans Height et Width
C'est peut etre pas tres pro mais plus simple (pour moi)
Cordialement.