Solved

Separate the navigation by downloading in embedded WebBrowser

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

895 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

14 Experts available now in Live!

Get 1:1 Help Now