Questions tagged [iwebbrowser2]
178 questions
12
votes
1 answer
Calling C++ function from JavaScript script running in a web browser control
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…

Tobbe
- 3,282
- 6
- 41
- 53
11
votes
2 answers
Why doesn't IWebBrowser2 refresh after a DOM change?
A have a web browser embedded in a dialog of my Win32 C++ application (no MFC, ATL, etc.) and I initially set the document's content from a string containing some HTML code. This HTML is rendered correctly. When the "document complete" event occurs,…

Dabbler
- 9,733
- 5
- 41
- 64
11
votes
1 answer
How to automate an IE webapp that pops a modal HTML dialog?
[Revised yet again for clarity]
I have a C++ program which interacts with a website. The site is IE-specific, and so is my program.
I'm connecting to the running instance of IE in an ordinary way (out of process -- see code). Once I get the…

egrunin
- 24,650
- 8
- 50
- 93
11
votes
2 answers
How to make TWebBrowser Zoom when using ctrl+mousewheel like Internet Explorer does?
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…

jasonpenny
- 2,999
- 1
- 24
- 23
10
votes
1 answer
Javascript in Delphi TWebBrowser, Closing Threads
I am attempting to build a system in delphi that allows users to use Google Maps. It all works fine, but i'm noticing that every time a new TWebBrowser object is created and the javascript that handles Google Maps is loaded, a number of new Threads…

user1242937
- 191
- 1
- 2
- 6
6
votes
5 answers
Supressing Script Error in IE8 (C++)
I want to prevent IE from showing JS error dialogs, I read that it can be done by setting
ScriptErrorsSuppressed = true.
Where exactly do I set it in IWebBrowser2?
Thanks

kambi
- 3,291
- 10
- 37
- 58
6
votes
1 answer
IWebBrowser2 object uses IE7 version, instead of the IE version installed on the machine
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…

Bagelzone Ha'bonè
- 1,192
- 1
- 14
- 29
6
votes
1 answer
How do I add an event listener using MSHTML's addEventListener in IE9?
The MSDN documentation for addEventListener says it accepts a callback function in the form of an IDispatch * object. From C# (I'm using COM interop), Visual Studio displays the parameter type as just object.
I looked for an IEventListener interface…

ide
- 19,942
- 5
- 64
- 106
6
votes
1 answer
How to get the URL for which downloadBegin() event is fired?
I am attempting to create a custom web browser based on the WPF Web browser control. I have implemented the IWebBrowser2 com interface and implemented the handlers for Navigating(), NavigatedTo() and LoadCompleted() events.
But these event callbacks…

kinshuk4
- 3,241
- 3
- 33
- 41
6
votes
2 answers
How to bypass Internet Explorer Enhanced Security when using embedded WebBrowser control?
i have a native Windows application that embeds the WebBrowser, i.e.
CLSID_WebBrowser
8856F961-340A-11D0-A96B-00C04FD705A2
Shell.Explorer.2
Unfortunately, when running on Windows Servers, the Internet Explorer Enhanced Security mode interferes…

Ian Boyd
- 246,734
- 253
- 869
- 1,219
5
votes
3 answers
How to Cleanly Destroy WebBrowser Control
I am using ATL in VisualC++10 to host browser control.
My code is similar to this example: http://msdn.microsoft.com/en-us/library/9d0714y1(v=vs.80).aspx
Difference is I have main window and then child window hosts the browser control.
After 2…

hB0
- 1,977
- 1
- 27
- 33
5
votes
5 answers
IWebBrowser2: how to force links to open in new window?
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…

Rob McAfee
- 581
- 1
- 5
- 11
5
votes
2 answers
Hooking the http/https protocol in IE causes GET requests to be sequential
I'm using the PassthruAPP method to hook into HTTP/HTTPS requests made by IE.
It's working well for the most part, however I noticed a problem. Only one download thread is active at a time, normally IE uses two download threads. I can see two…

watsonmw
- 321
- 2
- 13
5
votes
1 answer
IWebbrowser2 IE=edge and User agent string
I'm developping a winapi c++ program that uses IWebBrowser2 embedded control.
I'm running Windows 7 + IExplore 11 so when I open IE11 and call to my server I get this User Agent string:
Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like…

Miquel
- 8,339
- 11
- 59
- 82
4
votes
1 answer
How do I redirect the TWebBrowser control to a custom URL?
Example:
I navigate to http://www.stackoverflow.com with my web browser control
there's a link to FAQ in the top bar, with target https://stackoverflow.com/faq
I need to redirect e.g. to the http://math.stackexchange.com when I click the FAQ link

TLama
- 75,147
- 17
- 214
- 392