1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
Private Declare Function GetSystemMenu _
Lib "user32" ( _
ByVal hwnd As Long, _
ByVal bRevert As Long) As Long
Private Declare Function DeleteMenu _
Lib "user32" ( _
ByVal hMenu As Long, _
ByVal nPosition As Long, _
ByVal wFlags 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 EnableWindow _
Lib "user32" ( _
ByVal hwnd As Long, _
ByVal bEnable As Long) 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 Sub UserForm_Activate()
EnableWindow FindWindow(vbNullString, Application.Caption), 1
End Sub
Private Sub UserForm_Initialize()
Dim ID As Long
ID = FindWindow(vbNullString, Me.Caption)
'131072 Réduire
'65536 Agrandir
'196608 Réduire + Agrandir
SetWindowLong ID, -16, GetWindowLong(ID, -16) Or 196608
End Sub |
Partager