开发者

WebBrowser Control in 32bit app Launches 64bit Internet Explorer on window.open() call

开发者 https://www.devze.com 2023-01-07 20:00 出处:网络
I have a 32bit application running on Windows 7 64bit. The application (written in C++) hosts a WebBrowser control.

I have a 32bit application running on Windows 7 64bit. The application (written in C++) hosts a WebBrowser control.

When the WebBrowser control is asked to popup a new windows (through a javascript window.open() call), it launches a new Internet Explorer process. In particular, this new IE process is a 64bit IE process开发者_开发知识库.

Since web pages love Adobe Flash, I unfortunately need to make sure new IE process that is launched is the 32bit version (which is the default on my machine), so that AdobeFlash content can be displayed.

Interestingly enough, IE itself (wrapper around WebBrowser/MSHTML) does not suffer this problem, implying there is some kind of configuration that could be set to hint to the WebBrowser control to launch a 32bit process.

Any ideas where I should be looking to ensure that WebBrowser / MSHTML create the right process?


I suggest you to handle the DWebBrowserEvents2::NewWindow2 event. You can either open it in a webbrowser control in your own process, or in a new CLSID_InternetExplorer object.


This might be overkill for your application, but for me, changing the Platform target to x86 prevents 64-bit IE from being used either in the controls or in popups.

0

精彩评论

暂无评论...
验证码 换一张
取 消