Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Separate the navigation by downloading in embedded WebBrowser

Posted on 2006-06-23
1
Medium Priority
?
202 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:
2266180 earned 300 total points
ID: 16974605
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

876 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