Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Separate the navigation by downloading in embedded WebBrowser

Posted on 2006-06-23
1
192 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 100 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

Suggested Solutions

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 my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

860 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