CSDN博客

img shawls

禁止使用 Alt+F4 关闭窗口

发表于2001/6/3 19:45:00  755人阅读

 

 

禁止使用 Alt+F4 关闭窗口

声明:

'Vb man 2001
'URL: http://goodvbman.yeah.net
'E-mail: coolde@21cn.com

Private Declare Function GetSystemMenu Lib "user32" Alias "GetSystemMenu" 
(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 Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As 
Long) As Long
Private Const MF_BYPOSITION = &H400&

使用:

Private Sub Form_Load()
'Vb man 2001
'URL: http://goodvbman.
yeah.net
'E-mail: coolde@21cn.com

Dim hwndMenu As Long
Dim c As Long
hwndMenu = GetSystemMenu(Me.hwnd, 0)
c = GetMenuItemCount(hwndMenu)
DeleteMenu hwndMenu, c - 1, MF_BYPOSITION
c = GetMenuItemCount(hwndMenu)
DeleteMenu hwndMenu, c - 1, MF_BYPOSITION
End Sub

0 0

相关博文

我的热门文章

img
取 消
img