看看这: Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long Dim MyStr As String 'Create a buffer MyStr = String(GetWindowTextLength(hWnd) + 1, Chr$(0)) 'Get the window's text GetWindowText Me.hwnd, MyStr, Len(MyStr) MsgBox MyStr
注册表的数据,或者是写入文件也可以。还可以通过收发消息的方式(如果有网卡的话。)或者用API控制发送消息也可。
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long Dim MyStr As String
'Create a buffer
MyStr = String(GetWindowTextLength(hWnd) + 1, Chr$(0))
'Get the window's text
GetWindowText Me.hwnd, MyStr, Len(MyStr)
MsgBox MyStr