Solved

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

Posted on 2008-06-16
2
313 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

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…
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.

732 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