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

📄 module1.bas

📁 Desktop LockDesktop LockDesktop Lock
💻 BAS
字号:
Attribute VB_Name = "Module1"
Public Declare Function EnumWindows Lib "user32" _
     (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
    Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
     (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    Declare Function ShowWindow Lib "user32" (ByVal _
     hwnd As Long, ByVal nCmdShow As Long) As Long

    Public Const WS_MINIMIZEBOX = &H20000
    Public Const WS_VISIBLE = &H10000000
    Public Const GWL_STYLE = (-16)
    Public Const SW_MINIMIZE = 6

    '该函数是EnumWindows的回调函数,
    'EnumWindows函数将遍历的窗口句柄传递到hwnd参数中
    Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
     Dim l As Long
     Dim ld As Long
     ld = GetWindowLong(hwnd, GWL_STYLE)
     '如果窗口具有最小化按钮并且窗口是可见的就将该窗口最小化
     If ((ld And WS_MINIMIZEBOX) = WS_MINIMIZEBOX) Then
     If ((ld And WS_VISIBLE)) Then
     If ShowWindow(hwnd, SW_MINIMIZE) Then
     End If
     End If
     End If
     EnumWindowsProc = True
    End Function


⌨️ 快捷键说明

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