简体   繁体   English

使用window.open和WebBrowser控件调整Java大小

[英]Javascript resizing with window.open and WebBrowser control

I'm using WPF WebBrowser control and handling NewWindow3 events using following code: 我正在使用WPF WebBrowser控件,并使用以下代码处理NewWindow3事件:

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导航时如何处理javascript大小调整,如下所示:

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? 无论如何,在NewWindow3事件处理程序中是否可以获得调用者请求的高度和宽度?

No, but you can save the values in your INewWindowManager::EvaluateNewWindow implementation and use the values later. 否,但是您可以将值保存在INewWindowManager :: EvaluateNewWindow实现中,并在以后使用这些值。 An example can be found at http://code.google.com/p/csexwb2/source/browse/trunk/cEXWB.cs 可以在http://code.google.com/p/csexwb2/source/browse/trunk/cEXWB.cs中找到示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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