Hi Friend, Thank you, I am using web browser control, in windows application, so i get all the HtmlElement like body,form,div etc... from there i want to attache this. have a look at my code
mshtml.IHTMLElementCollection ecol = document.all;//getElementsByTagName("head");
if (ecol != null)
{
foreach (IHTMLElement elmnt in ecol)
{
string str = elmnt.outerText;
int k = 0;
if (elmnt.ToString() == "mshtml.HTMLHeadElementClass")
{
mshtml.IHTMLHeadElement head = (mshtml.IHTMLHeadElement)elmnt;
//mshtml.IHTMLElement se = document.createElement("script");
mshtml.IHTMLScriptElement element = (mshtml.IHTMLScriptElement)document.createElement("script");
//element.text = "alert('here we are')";
element.text ="function EventRaise(){var m = document.activeElement.value;alert(document.activeElement.type);alert('The active element is '+m); }";
IHTMLDOMNode node = (IHTMLDOMNode)element;
document.appendChild(node);
}
else if (elmnt.ToString() == "mshtml.HTMLBodyClass")
{
//need to call the EventRaise function
}
}
}
i hope you may have some idea on that... awaiting...