iwebbrowser2

IWebBrowser2 issues - how to open documents in new windows?

别等时光非礼了梦想. 提交于 2019-12-08 08:06:08
问题 I have IWebBrowser2 ctrl embedded into my own dialog. I want to simply display a promo banner within it from my url. How to disable all popup menu items from the control and force it to open links in new window (currently when I click on link in the banner, it is being opened within the same control). Regards Dominik 回答1: Have a look at the following article: WebBrowser Customization 回答2: I don't know if there is a more convenient way of doing this - but you could always intercept

How to get my IHttpNegotiate implementation called by IWebBrowser?

回眸只為那壹抹淺笑 提交于 2019-12-08 03:54:24
问题 I use cwebpage_src code and I need to update some HTTP request headers while clicking on links. As I understand it can be done with self implementation of IHttpNegotiate->BeginTransaction. But how to get my IHttpNegotiate implementation called?? Thanks! 回答1: Although I have no experience of writing one, I believe that you need to write an asynchronous pluggable protocol, as recommended in this thread. Details of how and why to do this are scattered around the web in various places, but the

Tab key doesn't work in IWebbrowser2

送分小仙女□ 提交于 2019-12-08 03:50:25
问题 I am using an ActiveX control to implement an embedded browser in an ATL app (IWebbrowser2). The problem is, that I can't jump between text fields using the tab key. Pressing the tab key just does nothing. Pressing the Enter key submits the form as expected. The problem exists e.g. on the facebook login site. How can I make the tab key work properly? Must I activate something in the ATL control to make this work? Thank you! Fabian 回答1: This article describes a way how to use IWebBrowser2 in C

How to get my IHttpNegotiate implementation called by IWebBrowser?

匆匆过客 提交于 2019-12-06 20:14:36
I use cwebpage_src code and I need to update some HTTP request headers while clicking on links. As I understand it can be done with self implementation of IHttpNegotiate->BeginTransaction. But how to get my IHttpNegotiate implementation called?? Thanks! Although I have no experience of writing one, I believe that you need to write an asynchronous pluggable protocol , as recommended in this thread . Details of how and why to do this are scattered around the web in various places, but the best exposition that I've read is in this post by Igor Tandetnik (abridged here for brevity): There are

Tab key doesn't work in IWebbrowser2

孤者浪人 提交于 2019-12-06 05:29:15
I am using an ActiveX control to implement an embedded browser in an ATL app (IWebbrowser2). The problem is, that I can't jump between text fields using the tab key. Pressing the tab key just does nothing. Pressing the Enter key submits the form as expected. The problem exists e.g. on the facebook login site. How can I make the tab key work properly? Must I activate something in the ATL control to make this work? Thank you! Fabian This article describes a way how to use IWebBrowser2 in C: http://www.codeproject.com/KB/COM/cwebpage.aspx In some comments below it, people have exactly the same

How do I render the scrollable regions of a canvas with IViewObject::Draw?

谁说胖子不能爱 提交于 2019-12-06 02:55:21
I've been trying to render the entire canvas in an IWebBrowser2 control to a bitmap. IViewObject::Draw seems to be the most promising approach, but I can't get it to render anything that would requires a scroll to show. While I could automate the scrolling and stitch the images together, this would look weird with any fixed position elements. Is this even doable? Additionally, I've tried to set the controller's size to one that would allow the entire contents to display without needing to scroll, but Windows caps the max size to the current screen resolution, so that only gets me partially

Returning string to JavaScript from C++ function

安稳与你 提交于 2019-12-04 14:19:36
问题 I have a class (JSObject) that implements the IDispatch interface. The class is exposed to JavaScript running in my hosted web browser control (IWebBrowser2). See more here about how this works: Calling C++ function from JavaScript script running in a web browser control I can call in to JSObject from my JavaScript code, and I can receive returned integers/longs. But something goes wrong when the function returns a string (BSTR). This is a part of the IDispatch::Invoke() code: int lenW =

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

我与影子孤独终老i 提交于 2019-12-03 18:05:46
问题 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 回答1: 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:

How to Cleanly Destroy WebBrowser Control

落爺英雄遲暮 提交于 2019-12-03 00:46:07
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 minutes i have to close the browser completely kill the browser activeX but this child window should be alive and do something else. But somehow this browser control still stays there, i can either see scrollbars or something.. I have also tried by creating child window to an existing child window, and at the time of closing browser I then destroy this

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

依然范特西╮ 提交于 2019-12-01 11:18:29
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 CompatibleBitmap. RECTL imageRect = {0, 0, nWidth, nHeight}; pHtmlDocument2->QueryInterface(IID