iwebbrowser2

Fork or copy a users browser session in IE

Is it possible to fork a users session (or do something similar) in a Internet Explorer plugin? I want to process the page the user is on when they click a button in the toolbar. To avoid interrupting the users browsing, I'd like to "copy" everything so I can parse and process the page in the background. The processing can involve thing...

IWebBrowser2.Navigate opens second window

The following code, on Vista with Internet Explorer 7, opens two windows (the one I create, and then a second one when Navigate is called, which is the one that the file appears in). This doesn't happen in Internet Explorer 8, or on XP as far as I know. Any idea how I can stop it doing that? SHDocVw.InternetExplorerClass ieObject...

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

Hi all, 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. ...

IWebBrowser2 issues - how to open documents in new windows?

Hello 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 ...

What event/interface is used to show the IWebBrowser2 secure warning?

I am using a IWebBrowser2 control in my application and writing my own container (in C++ - No ATL/MFC allowed). The control works fine. However web sites will not show if I am going from secure to non secure. It trails back to the setting in advanced options of IE (WarnonZoneCrossing) : Warn if changing between secure and not secure. ...

How to attach an event to IHTMLDocument2 link elements in Delphi?

I'm using this code to get all the links from an IHTMLDocument2: procedure DoDocumentComplete(const pDisp: IDispatch; var URL: OleVariant); var Document:IHTMLDocument2; Body:IHTMLElement; Links:IHTMLElementCollection; i:integer; tmp:IHTMLElement; begin try Document := (pDisp as IWebbrowser2).Document AS IHTMLDocument2; ...

TEventObject & IE tabs gives fatal error

I am using this code try document := (pDisp as IWebbrowser2).Document AS IHTMLDocument2; Body := Document.body; Links := Document.links; for i := 0 to (Links.length-1) do begin tmp := (Links.item(i, 0) as IHTMLElement); tmp.onclick := TEventObject.Create(MyProcedure) as IDispatch; // THIS LINE end; exce...

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

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...

IWebBrowser2 Quit method fails with a E_FAIL result

I am hosting the web browser control in my own window. Here are the pertinent steps: CoGetClassObject(CLSID_WebBrowser, CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER, NULL, IID_IClassFactory, (void **)&pClassFactory) pClassFactory->CreateInstance(0, IID_IOleObject, (void **)&pObject); pClassFactory->Release(); pObject->SetClientSite...

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

Hi, 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 positi...

Detecting whether cookies are enabled through IWebBrowser2 Interface

Is it possible to detect whether cookies are enabled in Internet Explorer through the IWebBrowser2 Interface or through some other WebBrowser Control C/C++ interface? I can't see any obvious way to do it, but was wondering whether there is a subtle way. ...

Disable the "Internet explorer is not currently your default browser" warning when using IWebBrowser2

Hello I have a MFC application that launches a IWebBrowser2 window. On users computers where Internet Explorer is not their default browser they get the following warning message "Internet explorer is not currently your default browser. Would you like to make it your default browser?" Is there a way to disable this check before I...

How to take the snapshot of a IE webpage through a BHO (C#)

Hi, I am trying to build an IE BHO in C# for taking the snapshot of a webpage loaded in the IE browser. Here is what I'm trying to do: public class ShowToolbarBHO : BandObjectLib.IObjectWithSite { IWebBrowser2 webBrowser = null; public void SetSite (Object site) { ....... if (site != null) { ...

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 IInternetProtocol objects getting created, but IE uses only one at a time. This is happening...

IWebBrowser: How to specify the encoding when loading html from a stream?

Using the concepts from the sample code provided by Microsoft for loading HTML content into an IWebBrowser from an IStream using the web browser's IPersistStreamInit interface: pseudocode: void LoadWebBrowserFromStream(IWebBrowser webBrowser, IStream stream) { IPersistStreamInit persist = webBrowser.Document as IPersistStreamInit; ...

Javascript resizing with window.open and WebBrowser control

I'm using WPF WebBrowser control and handling NewWindow3 events using following code: IServiceProvider serviceProvider = (IServiceProvider)webBrowser.Document; Guid serviceGuid = SID_SWebBrowserApp; Guid iid = typeof(SHDocVw.WebBrowser).GUID; SHDocVw.WebBrowser wb = (SHDocVw.WebBrowser)serviceProvider.QueryService(ref serviceGuid, ref i...

Tab key support in an IWebBrowser2 control

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! ...

Manifest or Theme/Style for a IWebBrowser2 control?

The IWebBrowser2 control has password edit boxes which are squares. This happened many years ago if you were on an XP machine, and you had a password edit field without a manifest file, you would get squares (no character found for the * they put in there with that font). My application has a manifest file. However I don't know how to...

After Navigate2 Method returns S_OK Stuck at READYSTATE of READYSTATE_LOADING

I am working on a MFC Document View architecture application which has multiple documents and views and a tabbed window interface. I have been tasked with making an automatic switch to another tab on the press of the OK button in one of the other tabs. When the other tab is clicked on it uses a C++ wrapper over IWebBrowser2 to navigate...

Launch IE with specific BHO enabled

I have a IE BHO plugin that I only want to be enabled when the user launches IE from my program (The program starts IE using CreateProcess()). I don't want this BHO to be enabled when a user launches IE from outside my program, as that would mean any problems in the BHO could potentially mess up the user's normal browsing experience. W...