views:

148

answers:

1

I'm using WPF WebBrowser control and handling NewWindow3 events using following code:

IServiceProvider serviceProvider = (IServiceProvider)webBrowser.Document;
Guid serviceGuid = SID_SWebBrowserApp;
Guid iid = typeof(SHDocVw.WebBrowser).GUID;
SHDocVw.WebBrowser wb = (SHDocVw.WebBrowser)serviceProvider.QueryService(ref serviceGuid, ref iid);
wb.NewWindow3 += new SHDocVw.DWebBrowserEvents2_NewWindow3EventHandler(wb_NewWindow3);

How to handle javascript resizing when navigating using window.open, something like this:

window.open('Sample.htm',null,'height=200,width=400,status=yes,toolbar=no,menubar=no,location=no');

Is there anyway to get height and width requested by caller in NewWindow3 event handler?

A: 

No, but you can save the values in your INewWindowManager::EvaluateNewWindow implementation and use the values later. An example can be found at http://code.google.com/p/csexwb2/source/browse/trunk/cEXWB.cs

Sheng Jiang 蒋晟
Could you explain please. I'm not using C++
Raj
IE's API is COM, which is language-independent. You can use any COM-aware language to call IE's API. For meaning of APIs, refer to IE SDK documentation.
Sheng Jiang 蒋晟