!!!用下面的这段代码慢慢杀吧!!!
Attribute VB_Name = "Module1"
Option Explicit
Declare Function GetWindowText Lib "User32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare Function EnumWindows Lib "User32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Boolean
Dim S As String
S = String(80, 0)
Call GetWindowText(hwnd, S, 80)
S = Left(S, InStr(S, Chr(0)) - 1)
If Len(S) > 0 Then Form1.List1.AddItem S
EnumWindowsProc = True
End FunctionVERSION 6.00
Begin VB.Form Form1
Caption = "EnumWindows范例程序"
ClientHeight = 3495
ClientLeft = 60
ClientTop = 345
ClientWidth = 5100
LinkTopic = "Form1"
LockControls = -1 'True
ScaleHeight = 3495
ScaleWidth = 5100
StartUpPosition = 2 '屏幕中心
Begin VB.ListBox List1
Height = 2940
Left = 120
TabIndex = 1
Top = 120
Width = 3375
End
Begin VB.CommandButton Command1
Caption = "开始举例"
Height = 495
Left = 3600
TabIndex = 0
Top = 120
Width = 1335
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
List1.Clear
EnumWindows AddressOf EnumWindowsProc, 0&
End Sub
Attribute VB_Name = "Module1"
Option Explicit
Declare Function GetWindowText Lib "User32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare Function EnumWindows Lib "User32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Boolean
Dim S As String
S = String(80, 0)
Call GetWindowText(hwnd, S, 80)
S = Left(S, InStr(S, Chr(0)) - 1)
If Len(S) > 0 Then Form1.List1.AddItem S
EnumWindowsProc = True
End FunctionVERSION 6.00
Begin VB.Form Form1
Caption = "EnumWindows范例程序"
ClientHeight = 3495
ClientLeft = 60
ClientTop = 345
ClientWidth = 5100
LinkTopic = "Form1"
LockControls = -1 'True
ScaleHeight = 3495
ScaleWidth = 5100
StartUpPosition = 2 '屏幕中心
Begin VB.ListBox List1
Height = 2940
Left = 120
TabIndex = 1
Top = 120
Width = 3375
End
Begin VB.CommandButton Command1
Caption = "开始举例"
Height = 495
Left = 3600
TabIndex = 0
Top = 120
Width = 1335
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
List1.Clear
EnumWindows AddressOf EnumWindowsProc, 0&
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货