iwebbrowser2

Is there any way to draw Webbrowser content to a specific DC?

馋奶兔 提交于 2019-12-01 09:16:35
问题 These days, I tries to create a hiden WebBrowser control in my program, and Using the IViewObject interface draw to my custom DC. The result is fine, I got All the content I want, but the Draw speed is unacceptable, especially some complex web pages which contains Flash objects, Each Draw to DC cost more than 100 ms . So the flash object I drew is not smooth. Is there a fast way to draw the control to my a specific DC? my code sinpet is like this: //hCompDc is a CompatibleDC which select a

Disable script debugging in IWebBrowser2 OLE control? C++

时间秒杀一切 提交于 2019-12-01 00:50:14
I have a IWebBrowser2 I use to visit some webpages with .Navigate() When the page has a js error I got a warning box for "Syntax error", so I used .put_Silent(TRUE) . And now I get a warning for "VS Just-In-Time Debugger: Unhandled exception" instead How can I disable all the script error warnings (including JIT debugger) from my code (i mean without modifying the real IE settings) ? You can disable script debugging by overriding the registry settings that control it. The correct way to do this is to implement the IDocHostUIHandler interface, and specifically the IDocHostUIHandler:

How do I add an event listener using MSHTML's addEventListener in IE9?

余生颓废 提交于 2019-11-30 21:24:08
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 or something similar but didn't find one. What am I supposed to pass in? After some research, I learned that these COM connection points (event handlers) are specified with DispId(0) . Callback functions are represented by instances of classes like: // These attributes may be optional, depending on the project configuration. [ComVisible(true)]

Disable script debugging in IWebBrowser2 OLE control? C++

一笑奈何 提交于 2019-11-30 19:54:23
问题 I have a IWebBrowser2 I use to visit some webpages with .Navigate() When the page has a js error I got a warning box for "Syntax error", so I used .put_Silent(TRUE). And now I get a warning for "VS Just-In-Time Debugger: Unhandled exception" instead How can I disable all the script error warnings (including JIT debugger) from my code (i mean without modifying the real IE settings) ? 回答1: You can disable script debugging by overriding the registry settings that control it. The correct way to

Hooking the http/https protocol in IE causes GET requests to be sequential

佐手、 提交于 2019-11-30 05:45:12
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 IInternetProtocol objects getting created, but IE uses only one at a time. This is happening with IE7, I haven't tried with other versions yet. The problem seems to be that IE falls back to downloading items one at a time when IInternetSession::RegisterNameSpace is called for any of its default handlers. The code below causes HTTP downloads to be

How do I add an event listener using MSHTML's addEventListener in IE9?

好久不见. 提交于 2019-11-30 05:27:26
问题 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 or something similar but didn't find one. What am I supposed to pass in? 回答1: After some research, I learned that these COM connection points (event handlers) are specified with DispId(0) . Callback functions are represented by instances of

Tab key support in an IWebBrowser2 control

元气小坏坏 提交于 2019-11-29 14:30:35
I have an embedded IWebBrowser2 control using straight C++ (windowed, not windowless) and when someone hits the Tab key to go between fields in the browser, it jumps focus out of the web browser. Any ideas on what I need to implement or what I could be screwing up? Thanks! Accelerator keystrokes like tab are handled by the message loop before being dispatched. As such a hook function needs to be called by a message loop - IOleInPlaceActiveObject::TranslateAccelerator iirc. - to give the control the chance to do keyboard navigation type things. I solved this problem by below link. http://social

How do I redirect the TWebBrowser control to a custom URL?

女生的网名这么多〃 提交于 2019-11-29 07:55:04
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 The easiest way, as kobik suggested is to use TWebBrowser.OnBeforeNavigate2 event. Here is the example. procedure TForm1.WebBrowser1BeforeNavigate2(ASender: TObject; const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData, Headers: OleVariant; var Cancel: WordBool); begin if URL = 'https://stackoverflow.com/faq' then begin // setting

Hooking the http/https protocol in IE causes GET requests to be sequential

↘锁芯ラ 提交于 2019-11-29 04:01:30
问题 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 IInternetProtocol objects getting created, but IE uses only one at a time. This is happening with IE7, I haven't tried with other versions yet. The problem seems to be that IE falls back to downloading items one at a time when IInternetSession:

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

不羁岁月 提交于 2019-11-29 03:59:43
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 pvaIn, pvaOut: OleVariant; begin pvaIn := 100; pvaOut := NULL; WebBrowser1.ControlInterface.ExecWB