THTMLDocument document; //in global scope
WebBrowser1->Navigate("http://www.google.com"); // test with this URL
document.webBrowser = WebBrowser1;
THTMLElement elm = document.getElementById("gog");
ShowMessage(elm.innerHTML);
THTMLElement myElm;
document.webBrowser = WebBrowser1;
myElm = document.getElementById("gog");
myElm.onclick = &OnClick;
void OnClick();
...and in the CPP file write:
void TForm1::OnClick()
{
THTMLEventObj event = document.parentWindow.event;
ShowMessage(event.x); // mouse pos
ShowMessage(event.ctrlKey); // if ctrl pressed
event.returnValue = 0; // for cancel event
...
}
Notes:
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)