Solved

IE Navigation from IE Tool Bar developed in Delphi through TWebBrowser Control

Posted on 2008-06-16
2
320 Views
Last Modified: 2013-11-23
I have embedded a TWebBrowser control in my IE Tool (being developed in Delphi) to have a marquee of news headlines with hyperlinks. Now I need to capture the Hyperlink clicked in WebBrowser control and navigate Internet Explorer to that link. I need your expert samples to achieve this. Thanks a lot in advance for all your support in IE tool bar development.
0
Comment
Question by:SHAHEEN_AKHTAR
[X]
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
2 Comments
 
LVL 35

Accepted Solution

by:
torimar earned 500 total points
ID: 21812334
Hi,

I haven't been able to test it (no Delphi here on this workstation), but the following code should give you an idea on how to proceed.
Theoretically, all you need to do is code an event handler for the TWebBrowser.OnBeforeNavigate2 event and send the URL clicked by the user to IE via shellexecute.

Here's some sample code:
procedure TForm1.WebBrowser1.BeforeNavigate2(Sender: TObject; const pDisp: IDispatch; var URL,  Flags, TargetFrameName, PostData, Headers: OleVariant;
  var Cancel: WordBool);
begin
  ShellExecute(self.WindowHandle,'open',PChar(string(URL)),nil,nil, SW_SHOWNORMAL);
end;

Open in new window

0
 

Author Closing Comment

by:SHAHEEN_AKHTAR
ID: 31467549
Kindly check posts on my question TWebBrowser Events Capture.
That addressed all my problems. This may also help you for similar tasks.

Thanks a lot
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

687 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