1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
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
Sub enleveCroix(UF As UserForm)
Dim hwnd As Long
'Enlève la croix rouge de l'UF,pour empêcher sa fermeture
hwnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", "X", "D") _
& "Frame", UF.Caption)
SetWindowLongA hwnd, -16, GetWindowLongA(hwnd, -16) And &HFFF7FFFF
End Sub |
Partager