Example of Handling HTML Element Events in Microsoft Internet Explorer

The technique makes use of the Microsoft Foundation Classes (MFC) CHTMLView web browser component to gain access to the DHTML Object Model (Microsoft's HTML DOM). Portions of this technique were extracted from an original coding example found on the Microsoft Developer Network workshop area on the Microsoft Web

Once access to the DOM has been achieved, the IE DOM will be used to enumerate all the DOM elements of which we will select one to add an event listener to monitor the onClick event.

It is assumed that a Microsoft Foundation Classes (MFC) application is hosting the WebBrowser control, or launching Internet Explorer.

This article is divided into the following sections: