Results 1 to 15 of 15

Thread: Internet Explorer_Server class window

Hybrid View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: Internet Explorer_Server class window

    Im guessing the code won't work because it is some sort of HTML object. Anyone know how to pull text from the Internet Explorer_Server class window? The same class is used as the main window in Internet Explorer, so surely someone out there has done it.

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: Internet Explorer_Server class window

    I now am pulling the HTML Object out of the window, but I am still getting a blank document. Here is some of the code :
    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         Dim objDoc As IHTMLDocument
    3.         hWndTmp = FindWindow("IMClass", "*window title*")
    4.         hWndChild = FindWindowEx(hWndTmp, 0, "YHTMLContainer", vbNullString)
    5.         hWndIEServer = FindWindowEx(hWndChild, 0, "Internet Explorer_Server", vbNullString)
    6.         MsgBox(hWndIEServer)
    7.         If hWndIEServer > 0 Then
    8.             objDoc = WindowDOM(hWndIEServer)
    9.             If Not (objDoc Is Nothing) Then
    10.                 MsgBox(objDoc.body.innerText)
    11.             End If
    12.         End If
    13.     End Sub
    The Associated Functions and structures are below :
    VB Code:
    1. Declare Function ObjectFromLresult Lib "oleacc.dll" ( _
    2.         ByVal lResult As Int32, _
    3.         ByVal riid As UUID, _
    4.         ByVal wParam As Int32, _
    5.         ByVal ppvObject As Object) As Int32
    6.  
    7.     Declare Function RegisterWindowMessage Lib "user32.dll" Alias "RegisterWindowMessageA" ( _
    8.         ByVal lpString As String) As Int32
    9.  
    10.     Declare Function SendMessageTimeout Lib "user32.dll" Alias "SendMessageTimeoutA" ( _
    11.         ByVal hWnd As Int32, _
    12.         ByVal Msg As Int32, _
    13.         ByVal wParam As Int32, _
    14.         ByVal lParam As Int32, _
    15.         ByVal fuFlags As Int32, _
    16.         ByVal uTimeout As Int32, _
    17.         ByVal lpdwResult As Int32) As Int32
    18.  
    19.     Public Structure UUID
    20.         Public Data1 As Long
    21.         Public Data2 As Integer
    22.         Public Data3 As Integer
    23.         Public Data4() As Byte
    24.     End Structure
    25.     Public Function WindowDOM(ByVal hWnd As Int32) As IHTMLDocument
    26.         Dim typUUID As UUID, lngRes As Int32, lngMsg As Int32
    27.         lngMsg = RegisterWindowMessage("WM_HTML_GETOBJECT")
    28.         'MsgBox(lngMsg.ToString & " lngmessage")
    29.         If lngMsg <> 0 Then
    30.             Call SendMessageTimeout(hWndIEServer, lngMsg, 0, 0, SMTO_ABORTIFHUNG, 1000, lngRes)
    31.             MsgBox(lngRes.ToString)
    32.             If lngRes <> 0 Then
    33.                 With typUUID
    34.                     .Data1 = &H626FC520
    35.                     .Data2 = &HA41E
    36.                     .Data3 = &H11CF
    37.                     .Data4(0) = &HA7
    38.                     .Data4(1) = &H31
    39.                     .Data4(2) = &H0
    40.                     .Data4(3) = &HA0
    41.                     .Data4(4) = &HC9
    42.                     .Data4(5) = &H8
    43.                     .Data4(6) = &H26
    44.                     .Data4(7) = &H37
    45.                 End With
    46.                 Call ObjectFromLresult(lngRes, typUUID, 0, WindowDOM)
    47.             End If
    48.         End If
    49.     End Function
    The code all runs without errors, however the "objDoc = WindowDOM(hWndIEServer)" posted on the button click is a blank document, because the If statement isnt ran.

    The SendMessageTimeout function call in the WindowDom function brings back a message of 0, which is where i think the holdup is. I can feel im getting real close... anyone know of something i can try??

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