Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Browser activex control

Status
Not open for further replies.

MalcUK

Programmer
Apr 24, 2003
19
GB
I'm writing a small browser app in vfp around the Microsoft Browser control. All works fine except any page that opens a new window, opens it in IE. I have put code into Newwindow3 method which opens up a new instance of my browser, with the correct page, but the page still opens in IE as well.

I've tried adding NODEFAULT to the method, both in newwindow3 and newwindow2. Doesn't help. There is a 'cancel' parameter passed to these methods, but I cant work out how to use it.

Any ideas?
 
Malc,

Can you provide more details of how you are navigating. I don't see why you need code in the NewWindow events. You should just be able to call Navigate2 to show a page within the control, after which the user should be able to follow hyperlinks. None of this should open a new instance of IE.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Sure ... sorry I wasn't clear. Eg I use Navigate2 to display On that page I click a link. My google preferences are set to open the selected link in a new window, but the default behaviour of the control is to display it in IE.

The control automatically calls the NewWindow3 method with parameters containing the link url, so I can trap it and launch my own browser again with the new requested page, but the default behaviour still results in IE launching as well! NODEFAULT doesnt inhibit this.

Is that any clearer?
 
Malc,

Yes, I see what you mean now. In fact, I've just reproduced your scenario, with the same results.

I thought that setting the Cancel flag in BeforeNavigate2 or NewWindow would solve the problem. But I just tried that. It seems that BeforeNavigate2 isn't even fired when you open a new browser window, and setting it in NewWindow doesn't seem to have any effect.

If I get a moment later, I'll play with it some more, and report back if I come up with anything.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top