模块:
#Region " 使关闭按钮不能用的函数及相关常数、方法"
Private Declare Function GetSystemMenu Lib "User32" (ByVal hwnd As Integer, ByVal bRevert As Integer) As Integer
Private Declare Function RemoveMenu Lib "User32" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer
Private Const MF_REMOVE As Short = &H1000S
Private Const SC_CLOSE As Short = &HF060S
Public Sub Disabled(ByRef a As Object, ByRef b As Object)
Dim hMenu As Object
Dim hwndMenu As Integer
Dim c As Integer
hMenu = GetSystemMenu(a, 0)
RemoveMenu(hMenu, SC_CLOSE, MF_REMOVE)
End Sub
#End Region