DelphiFAQ Home Search:

Catching Browsers' URLs with DDE

 

comments1 comments. Current rating: 5 stars (1 votes). Leave comments and/ or rate it.

Question:

I try to catch all URLs that all instances of the web browser visit. I try to achieve this with DDE, but sometimes miss URLs.


Answer:

I did the same job not long ago. The code works alright with Netscape but with IE you will run into a problem.

If you start IE and then open additional windows with the 'New Window' menu item, then you are running only ONE instance and you will get successfully all URLs.

BUT:

If you start a second instance of IE by clicking on the icon in your start menu a second.. then only one of your two instances will report DDE messages to your Delphi program. Usually the first started one seems to reply.

There is no clean solution around it.

I ended up enumerating top level windows and manually checking each top level window whether it was an IE instance. Then I would move through the child window chain with FindWindow(), GetWindowClass() and so on.. and retrieve the URL that way. The same code actually worked for IE 4, IE 5.0 and IE 5.5. I did not test with IE 6.

The code needed a modification for Netscape, naturally.
Content-type: text/html

Comments:

2006-05-19, 05:34:52
[hidden] from Canada  
rating
Hi,

Funny that I just found this info, its been weeks that I scratch my head to find a solution to the exact problem mentionned here. The solution seem excellent. Do you have an example for the solution that you are mentionning?
Thanks!

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: