窗口
Option Explicit
Private Declare Function EnumWindows& Lib "user32" ( _
ByVal lpEnumFunc As Long, ByVal lparam As Long)Private Sub Form_load()
EnumWindows AddressOf enumwindowsproc, 0&
End Sub模板
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" ( _
ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Function enumwindowsproc(ByVal hwnd As Long, ByVal lparam As Long) As Boolean
Dim s As String
s = String(80, 3)
Call GetWindowText(hwnd, s, 80)
s = Left(s, InStr(s, Chr(0)) - 1)
' Form1.List1.Clear
If Len(s) > 0 And UCase(s) = "ELEMENT CLIENT" Then Form1.Combo1.AddItem s
enumwindowsproc = True
End Function我用这段代码搜索窗口,然后筛选出了窗口
我想读取combo里选择的那个窗口 求解求解。。!!!!!!
Option Explicit
Private Declare Function EnumWindows& Lib "user32" ( _
ByVal lpEnumFunc As Long, ByVal lparam As Long)Private Sub Form_load()
EnumWindows AddressOf enumwindowsproc, 0&
End Sub模板
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" ( _
ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Function enumwindowsproc(ByVal hwnd As Long, ByVal lparam As Long) As Boolean
Dim s As String
s = String(80, 3)
Call GetWindowText(hwnd, s, 80)
s = Left(s, InStr(s, Chr(0)) - 1)
' Form1.List1.Clear
If Len(s) > 0 And UCase(s) = "ELEMENT CLIENT" Then Form1.Combo1.AddItem s
enumwindowsproc = True
End Function我用这段代码搜索窗口,然后筛选出了窗口
我想读取combo里选择的那个窗口 求解求解。。!!!!!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货