Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8070035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:15:55+00:00 2026-06-05T13:15:55+00:00

I need to evaluate the document from each browser window and act accordingly. I’m

  • 0

I need to evaluate the document from each browser window and act accordingly. I’m using shellwindows to obtain the IwebBrowser2. Then I have access to all the document properties I need. ie…

ShellWindows := TshellWindows.Create(nil);

…

ShellWindowDisp := ShellWindows.Item(Count); //for loop

…

ShellWindowDisp.QueryInterface(iWebBrowser2, WebBrowser);

etc….

This method works fine as far as I can tell. However, if one of the documents change my code will never know it. So I need to monitor Explorer for events such as OnDocumentComplete. Dumping the code above into a timer and comparing properties obviously is not the way to go. I’ve found several components that capture events but would rather not rely on a third party component for this. Since my knowledge on this area is limited I need to understand what is going on. Any good articles out there that explain how to approach this, preferably with simple source code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:15:56+00:00Added an answer on June 5, 2026 at 1:15 pm

    In order to access the events of the WebBrowser instances, you must get a pointer to the IConnectionPointContainer interface using the QueryInterface method of the IWebBrowser2 interface, then call the FindConnectionPoint method passing the GUID of the DWebBrowserEvents2 interface and finally call Advise method of the IConnectionPoint interface to start to receive the events.

    Something like so

    var
     LConnectionPointContainer : IConnectionPointContainer;
     LConnectionPoint : IConnectionPoint;
     dwCookie: Longint;
    begin
      //LWebBrowser2 is a IWebBrowser2 object
      LWebBrowser2.QueryInterface(IConnectionPointContainer, LConnectionPointContainer);
      LConnectionPointContainer.FindConnectionPoint(DWebBrowserEvents2, LConnectionPoint);
      LConnectionPoint.Advise(Self, dwCookie);
    end;
    

    All this code must be implemented inside of a class which descends from IDispatch in order to receive the events in the Invoke method. As in your case you need intercept the DocumentComplete event you must check when the value of the DispID parameter is 259.

    If you want a sample of this explanation, try checking this code intercept Internet Explorer messages.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to upload files from web browser to S3. I evaluated many upload
var links = document.evaluate(//BODY/CENTER[1]/P[1]/TABLE[1]/TBODY[1]/TR[1], document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null).evaluate(//A); basically I need to find an element
I'm using the following code... var result = document.evaluate(expr,context,null,9,null); When printing the result I
I need to remove attribute from XML document by this attribute's XPath. Everything should
I need to create a XML Document object using the NodeList. Can someone pls
Say I need to evaluate a expression as true or false starting from a
I need to evaluate a Python expression from C++. This code seems to work:
we need to evaluate a value in an object in run time while we
I need to evaluate and dig more into the use of Remote Procedure Call
Say i have a string that i need to evaluate in javascript such as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.