vb中vb.net教程禁用关闭按钮
Option Explicit
Private Declare Function GetSystemMenu Lib "USER32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function GetMenuItemCount Lib "USER32" (ByVal hMenu 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 Declare Function DrawMenuBar Lib "USER32" (ByVal hwnd As Long) As Long
Private Const MF_BYPOSITION = &H400&
Private Const MF_REMOVE = &H1000&
Private Sub DisableX()
Dim hMenu, nCount, LO As Long
hMenu = GetSystemMenu(Me.hwnd, 0)
nCount = GetMenuItemCount(hMenu)
LO = RemoveMenu(hMenu, nCount - 1, MF_REMOVE Or MF_BYPOSITION)
LO = RemoveMenu(hMenu, nCount - 2, MF_REMOVE Or MF_BYPOSITION)
End Sub
Private Sub Form_Load()
Call DisableX
End Sub





![战神引擎传奇手游【1.76盛战传奇免授权版[摸摸登陆器]】最新整理Win系复古服务端+安卓苹果双端+GM授权物品后台+详细搭建教程](https://cdn.jxasp.com:9143/image/20251106/1B4E8594B3BEB90E8601D63A8A39CB0B.jpg)













