Use APIs to obtain the HTML of the Internet assumer_server class

Source: Internet
Author: User

  

First, find the class handle containing Internet assumer_server,

Htmldocumentclass result = (htmldocumentclass) documentfromdom (hwnd. toint32 ());

  Result. activeelement. innerhtmlAll html

 

  

Private Static ihtmldocument2 documentfromdom (INT hwnd)
{
Ihtmldocument2 document = NULL;

Int lres = 0;
Int lngmsg = nativemethods. registerwindowmessage ("wm_html_getobject ");
Guid iid_ihtmldocument = new GUID ("626fc520-a41e-11cf-a731-00a0c9082637 ");
If (lngmsg! = 0)
{
Nativemethods. sendmessagetimeout (hwnd, lngmsg, 0, 0, nativemethods. smto_abortifhung, 1000, ref lres );
If (! (Bool) (lres = 0 ))
{
Int hR = nativemethods. objectfromlresult (lres, ref iid_ihtmldocument, 0, ref document );
If (bool) (document = NULL ))
{
MessageBox. Show ("No ihtmldocument found! "," Warning ");
}
}
}

Return document;
}

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.