iwebbrowser2

IWebBrowser2 object uses IE7 version, instead of the IE version installed on the machine

試著忘記壹切 提交于 2019-11-28 10:19:29
I'm developing on a Win7 machine with IE8 browser (same thing occurs also on IE9). I've create an application with an IWebBrowser2 object embedded within a native window. Within that browser object i execute a javascipt code: var txt = "Browser Name: " + navigator.appName + "\n"; txt += "Browser Version: " + navigator.appVersion + "\n"; alert(txt); and i receive the following alert: That confirmed my earlier worries - even when having IE8\IE9 installed on my machine - the IWebBrowser2 object behaves as if it was IE7 (including all of the annoying HTML\CSS behaviors). Does anyone know why this

Calling C++ function from JavaScript script running in a web browser control

前提是你 提交于 2019-11-28 05:06:56
I have embedded a web browser control in my c++ application. I want javascript running in the web browser control to be able to call a c++ function/method. I have found mentions of three ways to do this: Implement an ActiveX component that acts as a middle man. (Implementation details here: http://blogs.msdn.com/b/nicd/archive/2007/04/18/calling-into-your-bho-from-a-client-script.aspx ) Use window.external. (Also discussed in the link above, but no implementation provided) Add a custom object to the window object I want to go with the third option, but I haven't found any working examples on

How to make TWebBrowser Zoom when using ctrl+mousewheel like Internet Explorer does?

两盒软妹~` 提交于 2019-11-27 18:04:35
问题 According to http://www.rendelmann.info/blog/CommentView,guid,356fbe68-3ed6-4781-90a4-57070a0141da.aspx and http://msdn.microsoft.com/en-us/library/aa770056(v=vs.85).aspx getting the hosted WebBrowser to zoom using the control key and the mouse wheel should just require calling IWebBrowser2.ExecWB(OLECMDID_OPTICAL_ZOOM, ...) with a pvaIn value of 100 , but after calling it, ctrl+mousewheel still doesn't zoom the content Code I'm using with Delphi 2007: const OLECMDID_OPTICAL_ZOOM = 63; var

IWebBrowser2: how to force links to open in new window?

╄→гoц情女王★ 提交于 2019-11-27 07:08:29
问题 The MSDN documentation on WebBrowser Customization explains how to prevent new windows from being opened and how to cancel navigation. In my case, my application is hosting an IWebBrowser2 but I don't want the user to navigate to new pages within my app. Instead, I'd like to open all links in a new IE window. The desired behavior is: user clicks a link, and a new window opens with that URL. A similar question was asked and answered here and rather than pollute that answered post, it was