iwebbrowser2

Tab key support in an IWebBrowser2 control

ⅰ亾dé卋堺 提交于 2019-12-18 08:57:15
问题 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! 回答1: 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

Javascript in Delphi TWebBrowser, Closing Threads

孤人 提交于 2019-12-18 02:47:55
问题 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 is generated. My problem is that even once the webbrowser is destroyed (and it is definately destroyed) the created threads persist. I'm designing this program to have long running times and the opening and closing of google maps to happen many

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

*爱你&永不变心* 提交于 2019-12-17 17:48:12
问题 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

How do I listen the event of Running IE with IWebBrowser2 in C++ XE2?

爷,独闯天下 提交于 2019-12-12 19:00:42
问题 Currently I want to automate the running IE. I have successfully attached the running IE using below code (I assume there is only one IE within one tab) #include "atl/atlbase.h" #include <exdisp.h> #include <mshtml.h> CComQIPtr<IWebBrowser2> pCurIE; void __fastcall TForm4::Button3Click(TObject *Sender) { bool SuccessToHook = false; CComPtr<IShellWindows> m_spSHWinds; if (FAILED(m_spSHWinds.CoCreateInstance( __uuidof( ShellWindows)))){ return ; } LONG nCount; m_spSHWinds->get_Count( &nCount);

Why AddRef returns zero

我只是一个虾纸丫 提交于 2019-12-12 13:17:46
问题 I'm debugging C++/COM application, looking at how we AddRef and Release COM objects. I came around weird case when AddRef returns 0. Here is how I get the return value: ULONG TraceAddRef(LPUNKNOWN pUnk, const std::string &a_msg) { ULONG count = pUnk->AddRef(); // count == 0 at some point after execution ATLTRACE("%s *** AddRef: pUnk = 0x%p, referenceCount = %lu\n", a_msg.c_str(), pUnk, count); return count; } pUnk is actually IWebBrowser2 COM interface to a web control: pUnk 0x20d763ac

Using IWebBrowser2 to put Widgets in PowerPoint — Automation Error: Unspecified Error

雨燕双飞 提交于 2019-12-11 13:56:16
问题 I created a simple macro to put an HTML widget from Weather.com in to a PowerPoint slide. It is not event-based, but ActionButtons call the ConnectWidget subroutine, when navigating to the slide. That's working fine, but you will notice that I have only been able to get this to work by first deleting the existing WebBrowser shape, and then re-creating it. I had to do this, ultimately, because any method call from wb after the .Navigate , I get an Automation Error/Unspecified Error, or Method

IWebBrowser2 seemingly not executing javascript

不想你离开。 提交于 2019-12-11 05:06:53
问题 Users of our program occasionally have to download databases from a third-party website that requires them to log-in and specify parameters to get the correct database. I am trying to incorporate this into our program so that users don’t have to open a separate browser and also so that our program can access the database upon being downloaded. I’ve embedded a web browser into a dialog as specified in Microsoft’s “Using MFC to Host a WebBrowser Control”, but it apparently doesn’t seem to

How to get the screen coordinate of web-page elements in BHO

吃可爱长大的小学妹 提交于 2019-12-10 12:07:57
问题 I am writing a BHO object for IE. I want the screen position of the top-left of the web-page. How can i get this position? The topleft of the first element in DOM returns (0,0). The webBrowser.Left or Top returns the position of the browser but not the top-left of the page. I am using IWebBrowser2. Thanks a million, -anony. 回答1: You may have already figured this out, but using ClientToScreen function might help you. 回答2: I solved the problem myself. The IHTMLElement2.getBoundingClientRect()

How to fix javascript error in application using IWebBrowser2?

烈酒焚心 提交于 2019-12-10 11:18:11
问题 I have a C++ aplication that is using the IWebBrowser2 interface for rendering some online html pages. The problem is that when accesing a certain link I receive a javascript error, although if I am accesing that same page using Internet Explorer, the page loads with no error. The recived error in my application is "Object doesn't support this action" I was able to hide the error by using the put_Silent() method and setting it to VARIANT_TRUE, but this is not a solution as the content

IWebBrowser2 HTTP response headers

荒凉一梦 提交于 2019-12-08 13:55:52
问题 I have the same question that Dragos asked here "...Hi! I'm developing an application which hosts an web browser control. I'm getting access to it through IWebBrowser2 interface. Is there any way to have access programatically to the responses header..." The solution (from 2003) seems to be using an passthrough Asynchronous Pluggable Protocol (APP) handlers. The solution presented here was written in C++/ATL so I was wondering if there is an c# version of this? Note that I'm already able to