[code]
void __fastcall TForm1::WebDocumentComplete(TObject *Sender,
LPDISPATCH pDisp, Variant *URL)
{
IHTMLDocument2* pDoc2 = NULL;
Web->Document->QueryInterface(IID_IHTMLDocument2,(void**)&pDoc2);
// Assign desired events
if (pDoc2) {
IHTMLElement* pBody2 = NULL;
pDoc2->get_body(&pBody2);
if (pBody2)
{
TVariant vEventDispatch = CHtmlEvent<TForm1>::Create(this,
&TForm1::OnBrowserMouseMove, DISPID_MOUSEMOVE);
VARIANT_BOOL bSuccess;
((IHTMLElement2*)pBody2)->attachEvent(WideString
("onmousemove"), vEventDispatch, &bSuccess);
pBody2->Release();
}
pDoc2->Release();
}
}
[/code]
my function that should be called is
[code]
void TForm1::OnBrowserMouseMove(DISPID id, VARIANT* pVarResult)
{
ShowMessage("Mouse moved");
}
[/code]
Please help, thanks