去袁飞的网站上看看例程,那里有。
http://ygyuan.go.163.com
--------------------------------------------------------------------
Made by Thirdapple's Studio(http://3rdapple.51.net/)

解决方案 »

  1.   

    1、使用word排版时,得到word排版的文字内容,
    除非你用VBA内嵌,或HOOKAPI,否则做不到2、使用ie浏览器时,能得到ie浏览器显示的文字内容,
    除非你搜索IE实例(必须使用ActiveXDLL),或HOOKAPI,否则做不到3、使用其它程序时,选中程序,就能得到标题栏的内容,谢谢!
    标题栏简单,用 GetWindowText或SendMessage WM_GETTEXT都可以补充:HOOKAPI在VB里做不到,呵呵
      

  2.   

    例子: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 SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
    Private Sub Form_Activate()
        'KPD-Team 1998
        'URL: http://www.allapi.net/
        'E-Mail: [email protected]
        Dim MyStr As String
        'Create a buffer
        MyStr = String(100, Chr$(0))
        'Get the windowtext
        GetWindowText Me.hwnd, MyStr, 100
        'strip the rest of buffer
        MyStr = Left$(MyStr, InStr(MyStr, Chr$(0)) - 1)
        'Triple the window's text
        MyStr = MyStr + MyStr + MyStr
        'Set the new window text
        SetWindowText Me.hwnd, MyStr
    End Sub
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As LongPrivate Sub Form_Load()
    Dim s As String
    s = Space(200)
    SendMessage hwnd, WM_GETTEXT, 200, s
    MsgBox "标题:" + s
    End Sub