vb窗体让关闭按钮无效

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
Private Const MF_BYPOSITION = &H400&
Private Const MF_REMOVE = &H1000&
Private Const SC_CLOSE = &HF060&

Private Sub Form_Load()
RemoveMenu GetSystemMenu(Me.hwnd, 0), SC_CLOSE, MF_REMOVE
End Sub

你可能感兴趣的:(vb窗体让关闭按钮无效)