|
如下代码可以屏蔽acc2003的关闭按钮,可是到了acc2007中就不可用了,怎么解决?
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 Form_Open(Cancel As Integer)
'取消Access主窗体中的“关闭”按钮
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 |
|