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

📄 module1.bas

📁 灰色按钮克星1.0.rar灰色按钮克星灰色按钮克星1.0.rar1.0.rar灰色按钮克星灰色按钮克星1.0.rar1.0.rar
💻 BAS
字号:
Attribute VB_Name = "Module1"
Public Declare Function ChildWindowFromPoint Lib "user32" (ByVal hwnd As Long, ByVal xPoint As Long, ByVal yPoint As Long) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function GetActiveWindow Lib "user32" () As Long
Public Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Any) As Long
Public Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Public Declare Function IsWindowEnabled Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Declare Function GetForegroundWindow Lib "user32" () As Long

Public Const HWND_TOPMOST = -1

Public icount As Integer
Function GetText(Ihwnd As Long) As String
    Dim Textlen As Long
    Dim Text As String

    Textlen = SendMessage(Ihwnd, WM_GETTEXTLENGTH, 0, 0)
    If Textlen = 0 Then
        GetText = "(No text)"
        Exit Function
    End If
    Textlen = Textlen + 1
    Text = Space$(Textlen)
    Textlen = SendMessage(Ihwnd, WM_GETTEXT, Textlen, ByVal Text)
    GetText = Left$(Text, Textlen)

End Function
Public Function WndEnumChildProc(ByVal hwnd As Long, ByVal lParam As ListBox) As Long
    Dim bRet As Long
    Dim myStr As String * 50
    
    bRet = GetClassName(hwnd, myStr, 50)
    If IsWindowEnabled(hwnd) = 0 Then EnableWindow hwnd, 1
    
    'if you want the text for only Edit class then use the if statement:
    'If (Left(myStr, 4) = "Edit") Then
    
    'You can sort the enumerated windows into the listview control but
    'I would recommend not to do so bcuz its also worth learning the order
    'in which windows does the enumeration.
    lParam.AddItem Str(hwnd) & "--" & Left(myStr, 20) & "--" & GetText(hwnd)
    icount = icount + 1

    'End If
    WndEnumChildProc = 1

End Function

⌨️ 快捷键说明

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