返回列表 回复 发帖
所需阅读权限 1

[分享]禁止使用 Alt+F4 关闭窗口

  1. Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal
  2. nPosition As Long, ByVal wFlags As Long) As Long
  3. Private Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long)
  4. As Long
  5. Private Const MF_BYPOSITION = &H400&
  6. Private Sub Form_Load()
  7. Dim hwndMenu As Long
  8. Dim c As Long
  9. hwndMenu = GetSystemMenu(Me.hwnd, 0)
  10. c = GetMenuItemCount(hwndMenu)
  11. DeleteMenu hwndMenu, c - 1, MF_BYPOSITION
  12. c = GetMenuItemCount(hwndMenu)
  13. DeleteMenu hwndMenu, c - 1, MF_BYPOSITION
  14. End Sub
复制代码
哈哈哈!!!!你的IP是不是?我都知道了!!!
返回列表