Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = True
End Sub-----------------------
打工者
http://www.dagongzhe.net
Cancel = True
End Sub-----------------------
打工者
http://www.dagongzhe.net
调试欢乐多
Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Declare Function GetMenuString Lib "user32" Alias "GetMenuStringA" (ByVal hMenu As Long, ByVal wIDItem As Long, ByVal lpString As String, ByVal nMaxCount As Long, ByVal wFlag As Long) As Longsub form_load()
'以上三个API函数的实现方法
hMenu = GetSystemMenu(Me.hWnd, 0)
CloseStr = String(255, 0)
Call GetMenuString(hMenu, &HF060, CloseStr, 256, &H0&)
CloseStr = Left(CloseStr, InStr(1, CloseStr, Chr(0)) - 1)
Call DeleteMenu(hMenu, &HF060, &H0&)
end sub
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 Const SC_MAXIMIZE = &HF030
Private Const SC_MINIMIZE = &HF020Private Sub Command1_Click()
End
End SubPrivate Sub Form_Load()
RemoveMenu GetSystemMenu(hwnd, 0), SC_CLOSE, MF_REMOVE
End Sub