|
在窗体(数据库打开时始终显示的那个窗体)的代码事件中的最前面,把下面代码粘贴上去即可。
Option Compare Database
Option Explicit
Private Declare Function GetSystemMenu Lib "User32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function DeleteMenu Lib "User32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Sub NoAccessAppCloseButton() '取消系统菜单中关闭按钮
Const MF_BYCOMMAND = &H0&
Const SC_CLOSE = &HF060
Dim hMenu As Long
hMenu = GetSystemMenu(Application.hWndAccessApp, 0)
Call DeleteMenu(hMenu, SC_CLOSE, MF_BYCOMMAND)
End Sub
Private Sub NoAccessAppRestoreButton() '取消系统菜单中恢复按钮
Dim hSysMenu As Long
Dim RetVal As Long
hSysMenu = GetSystemMenu(hWndAccessApp, 0)
RetVal = DeleteMenu(hSysMenu, &HF120, &H0)
hSysMenu = GetSystemMenu(Me.hwnd, 0)
RetVal = DeleteMenu(hSysMenu, &HF120, &H0)
End Sub |
|