users_user-20.html - Désactiver le bouton de fermeture d'une fenêtre
- Public Const SC_CLOSE = &HF060&
- Public Const MF_BYCOMMAND = &H0&
- Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
- Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
- Public Sub DisableCloseBtn(oForm As Form)
- Dim hSysMenu As Long
- hSysMenu = GetSystemMenu(oForm.hwnd, False)
- RemoveMenu hSysMenu, SC_CLOSE, MF_BYCOMMAND
- End Sub
Poster un commentaire