Solved

Separate the navigation by downloading in embedded WebBrowser

Posted on 2006-06-23
1
189 Views
Last Modified: 2010-04-05
in EmbeddedWBBeforeNavigate2 event I have an own code that I wish to run just when I start to load a new page. The problem is that when I click a link and start to download a file the code run too.  

How can I separate these? I wish to run my code just for navigation and ignore it for downloading files.
0
Comment
Question by:ginsonic
1 Comment
 
LVL 28

Accepted Solution

by:
ciuly earned 100 total points
Comment Utility
I needed to do something similar, with the difference that I was loading the pages from disk and the links that the user clicked on were to be opened in the default browser.

the way I fixed it was to have a global boolean value, inner = false, and checking against it in the event.

in your case it's simpler.
before you load the page (you issue a navigate command yourself, from code), you set inner=true.
then in the event, if inner=true then execute the code AND set inner to false;

this way, the code executes only when you load the pages.

now, if you want to allow the user to open pages by clicking on links, things go harder. you will have to also check against the url and make sure it's not a file (the protocol is not ftp:// and not file:// and mayeb some other stuff). you can also use the headers and see the mime type. as I said, it gets trickier
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now