简体   繁体   中英

Javascript resizing with window.open and WebBrowser control

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM