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

📄 module1.bas

📁 灰色按钮克星
💻 BAS
字号:
Attribute VB_Name = "Module1"
'★★★★★****************************★★★★★**********************★★★★★
'金诺VB园-收藏整理
'本站是专注于VB和VBNET编程的源码下载站
'发布日期:2008-3-27 8:22:57
'网    站:http://www.vbget.com/          (金诺VB园)
'网    站:http://www.vbget.com/daohan/   (VB编程网址导航)
'E-Mail  :vbget@yahoo.cn
'QQ      :158676144
'源码作者:如果您有VB商业源码需要获得收益,本站将有VIP收费下载频道可供你发布!
'         您有权定价;改价;删除;及即时查看下载量(即收益),所有收益全部归您!
'         本站将在双方协商的一个金额周期内打款到作者帐户中,您只需负责打款费用!
'         本站只作为一个平台提供最新VB源码咨讯和源码下载!
'本注释由<站长工具之智能注释>软件自动添加!金诺VB园有此软件下载!
'★★★★★****************************★★★★★**********************★★★★★

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 + -