没有getwindowtexta()!!用
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long给你个小例子,刚写的还热着呢Private Sub Timer1_Timer()Dim strName As String * 100
Dim myhWnd As Long GetCursorPos myCursor
myhWnd = WindowFromPoint(myCursor.x, myCursor.y)
Call GetWindowText(myhWnd, strName, 100)
Debug.Print strName
End Sub
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long给你个小例子,刚写的还热着呢Private Sub Timer1_Timer()Dim strName As String * 100
Dim myhWnd As Long GetCursorPos myCursor
myhWnd = WindowFromPoint(myCursor.x, myCursor.y)
Call GetWindowText(myhWnd, strName, 100)
Debug.Print strName
End Sub
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As LongPrivate Const WM_GETTEXT = &HDPrivate Sub Timer1_Timer()Dim strName As String * 100
Dim myhWnd As Long GetCursorPos myCursor
myhWnd = WindowFromPoint(myCursor.x, myCursor.y)
SendMessage myhWnd, WM_GETTEXT, 100, ByVal strName
Debug.Print strNameEnd Sub
呵呵,都可以。
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As LongPrivate Type POINTAPI
x As Long
y As Long
End Type
Dim myCursor As POINTAPI行了,今天好兴致,有问题再问我。要是行了就100分吧