⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 moddisablexbutton.bas

📁 This application provides much functionality for creating data-driven reports, including preview, gr
💻 BAS
字号:
Attribute VB_Name = "modDisableXButton"
Option Explicit

Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Private Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long

Private Const MF_BYPOSITION& = &H400&
Private Const MF_REMOVE& = &H1000&


Public Sub DisableClose(ByVal WindowHandle As Long, Optional ByVal Disable As Boolean = True)
Dim hMenu As Long
Dim nCount As Long
    
    hMenu = GetSystemMenu(WindowHandle, CLng(Not Disable))
    If Disable Then
        nCount = GetMenuItemCount(hMenu)
        Call RemoveMenu(hMenu, nCount - 1, MF_REMOVE Or MF_BYPOSITION)
        Call RemoveMenu(hMenu, nCount - 2, MF_REMOVE Or MF_BYPOSITION)
    End If
    Call DrawMenuBar(WindowHandle)
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -