?
Solved

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

Posted on 2008-06-16
2
Medium Priority
?
326 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 1500 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

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. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses
Course of the Month13 days, 6 hours left to enroll

777 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