How to get a IHTMLElement pointer to the <object> tag hosting an activex control

前端 未结 2 951
情书的邮戳
情书的邮戳 2021-01-13 22:10

I have an ActiveX control generated by the FireBreath framework (http://firebreath.org). I need to get a reference to the tag in the page that hosts the plug
2条回答
  •  隐瞒了意图╮
    2021-01-13 22:39

    In C#:

        public int SetSite(object site)
        {
            if (site != null)
            {
                var oleControl = (IOleControlSite)site;
                object oHtmlElement;
                oleControl.GetExtendedControl(out oHtmlElement);
                var htmlElement = (IHTMLElement2)oHtmlElement;
                ...
            }
        }
    

提交回复
热议问题