[讨论]怎样把表单的右上角的关闭按纽禁用?
怎样把表单的右上角的关闭按纽禁用?我做个系统,不想让用户通过右上角的关闭按纽关闭系统。或者当用户点右上角的关闭按纽时,就会出我设计的关闭提示也可以。反正就是不想让用户误点。
声明
Public Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal brevert As Long) As Long
Public Declare Function RemoveMenu Lib "user32" (ByVal hwnd As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public Const MF_REMOVE = &H1000&
Public Const SC_CLOSE = &HF060 Private Sub Form_Load()
RemoveMenu GetSystemMenu(hwnd, 0), SC_CLOSE, MF_REM End Sub