ihtmldocument2

MSHTML tutorial

Hello everyone, I want to learn some basics about MSHTML, like how to use IHtmlDocument and IHtmlDocument2 interfaces. I searched for quite a while, but can not find out a tutorial for beginners. Could anyone recommend something to read? EDIT: I prefer to use C#. thanks in advance, George ...

When using Microsoft Html Control the ReadyState never gets further than Interactive

We are using the Microsoft MSHtml control to render and modify web pages, we have today deployed to Citrix and found that the document state often does not get any further than interactive while we are expecting it to get to completed. We are using c# and we do have a UI, like i said in my question this is an intermittant issue. Even wh...

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

WYSIWYG html editor query.

I am in the process of creating a simple WYSIWYG html editor to enable the users of my application to design simple html emails. At the moment I have decided to use the web browser control with mshtml to enable me to edit what is displayed. I have a tool bar which holds all of the relevant buttons (bold, underline, etc.). I need a way ...

Add onmouseover event in links rendered in C#.net webbrowser contrl

My task is to highlight selected words rendered in html in webbrowser control of C#.net. I accomplish it by using IHtmldocument2. (ref: http://www.codewrecks.com/blog/index.php/2009/02/13/highlight-words-in-webbrowser-control/). Now, my next task is when i mouseover on the highlighted text, a custom popup will appear to show some informa...

How to get HTML element coordinates using C#?

This is related to (http://stackoverflow.com/questions/1547614/how-to-get-html-element-coordinates-using-c) The answer given here is quite good. However, opening up a full instance of Internet Explorer seems like overkill if you're trying to process a good deal of information from within your own spider. Has anyone found/encountered/th...

Detect cursor position in TWebBrowser at edit mode

I get selection range like this: var Range: IHTMLTxtRange; begin if Supports((Document as IHTMLDocument2).selection.createRange, IHTMLTxtRange, Range) end; TWebBrowser in editing. I need get position of cursor. How I can get its? ...

how to create <tr> row and append/insert it into a table a run time ina web page + MSHTML

Hi I'm using IHTMLdocument2 to create Element This is my code: IHTMLdocument2 pDoc2;//it is initialized in ma code BSTR eTag = SysAllocString(L"TR"); IHTMLElement *pTRElmt = NULL; hr = pDoc2->createElement(eTag,&pTRElmt); if(FAILED(hr)) return hr; IHTMLDOMNode *pTRNode = NULL; hr = pTRElmt->QueryInterface(II...

Unable to add a row to a HTML table dynamically

I am unable to add a row to a HTML table dynamically. I am using IHtmlDocument2 to create tr and td elements and IHtmlElement to set attributes and IHtmlDomNode to add created node to the document hierarchy. Please anyone help me to solve the above problem. I am traversing through the document when I get the tr tag I have created the t...

IHTMLDocument2->open not working as expected from within activex control

Hi folks. Unfortunately I'm a complete novice when it comes to this kind of native windows programming. I have been tasked with attempting to figure this out within our group alas. Essentially I need an activex control to open a new browser window. In addition to this I would like to have a reference to the new windows hwnd when its done...

Detecting Render Start on Webbrowser Control

Trying to figure out when the webbrowser control starts rendering (displays something) to the end user. Any idea on how to achieve this? ...

How to query HTML with x XPath expression in C++?

I have a webbrowser and I use DocumentComplete to read the current document from the WebBrowser (as IHTMLDocument2). What's the easiest way to run xpath queries in that html doc? I am looking for something easy to use and lightweight. I am using Visual Studio C++ 2010. ...