Results 1 to 3 of 3

Thread: Getting Internet Explorer hyperlink when the mouse is moved over it

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    2

    Question

    Please anybody help me with this problem:

    I want to record all hyperlinks the mouse is moved over. When moving the mouse cursor over a link in IE the statusbar at the bottom of the IE window shows the link properties. I need this information somehow imported to my program running in the background.

    ---------------------------------
    MS Visual Basic 6.0 SP4
    Windows 98 Second Edition, IE 5.01
    AMD K6-2 450 MHz, 128 MB RAM
    ASUS board, Ali Aladdin V

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    You can monitor the text in the Statusbar using the API's in a Timer, i.e.
    Code:
    Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Private Const WM_GETTEXT = &HD
    
    Private Sub Timer1_Timer()
        Static sLastText As String
        Dim lHwnd As Long
        Dim sText As String
        
        lHwnd = FindWindowEx(0, 0, "IEFrame", vbNullString)
        lHwnd = FindWindowEx(lHwnd, 0, "msctls_statusbar32", vbNullString)
        sText = Space(256)
        sText = Left(sText, SendMessage(lHwnd, WM_GETTEXT, 256, ByVal sText))
        If sLastText <> sText Then
            sLastText = sText
            Debug.Print sText
        End If
    End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    2

    Smile

    That's exactly what I needed!

    THANKS!!!!



    ---------------------------------
    MS Visual Basic 6.0 SP4
    Windows 98 Second Edition, IE 5.01
    AMD K6-2 450 MHz, 128 MB RAM
    ASUS board, Ali Aladdin V

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width