Solved

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

Posted on 2008-06-16
2
301 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
2 Comments
 
LVL 35

Accepted Solution

by:
torimar earned 500 total points
Comment Utility
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
Comment Utility
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

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

Suggested Solutions

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
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…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

762 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

7 Experts available now in Live!

Get 1:1 Help Now