⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 列举ie全部element的代码.mht

📁 列举IE全部Element的代码
💻 MHT
📖 第 1 页 / 共 4 页
字号:
                     ' height=3D' + quoted(w.google_ad_height) +=0A=
                     ' frameborder=3D' + quoted(w.google_ad_frameborder) =
+=0A=
                     ' src=3D' + quoted(w.google_ad_url) +=0A=
                     ' marginwidth=3D"0"' +=0A=
                     ' marginheight=3D"0"' +=0A=
                     ' vspace=3D"0"' +=0A=
                     ' hspace=3D"0"' +=0A=
                     ' allowtransparency=3D"true"' +=0A=
                     ' scrolling=3D"no">');=0A=
      google_write_tracker('noiframe');=0A=
      document.write('</ifr' + 'ame>');=0A=
    }=0A=
  }=0A=
=0A=
  w.google_ad_frameborder =3D null;=0A=
  w.google_ad_format =3D null;=0A=
  w.google_page_url =3D null;=0A=
  w.google_language =3D null;=0A=
  w.google_gl =3D null;=0A=
  w.google_country =3D null;=0A=
  w.google_region =3D null;=0A=
  w.google_city =3D null;=0A=
  w.google_hints =3D null;=0A=
  w.google_safe =3D null;=0A=
  w.google_encoding =3D null;=0A=
  w.google_ad_output =3D null;=0A=
  w.google_max_num_ads =3D null;=0A=
  w.google_ad_channel =3D null;=0A=
  w.google_contents =3D null;=0A=
  w.google_alternate_ad_url =3D null;=0A=
  w.google_alternate_color =3D null;=0A=
  w.google_color_bg =3D null;=0A=
  w.google_color_text =3D null;=0A=
  w.google_color_link =3D null;=0A=
  w.google_color_url =3D null;=0A=
  w.google_color_border =3D null;=0A=
  w.google_color_line =3D null;=0A=
  w.google_adtest =3D null;=0A=
  w.google_kw_type =3D null;=0A=
  w.google_kw =3D null;=0A=
  w.google_num_radlinks =3D null;=0A=
  w.google_max_radlink_len =3D null;=0A=
  w.google_rl_filtering =3D null;=0A=
  w.google_rl_mode =3D null;=0A=
  w.google_ad_type =3D null;=0A=
  w.google_image_size =3D null;=0A=
  w.google_feedback =3D null;=0A=
  w.google_skip =3D null;=0A=
  w.google_page_location =3D null;=0A=
  w.google_referrer_url =3D null;=0A=
  w.google_ad_region =3D null;=0A=
}=0A=
=0A=
function google_error_handler(message, url, line) {=0A=
  google_show_ad();=0A=
  return true;=0A=
}=0A=
=0A=
window.onerror =3D google_error_handler;=0A=
=0A=
if (window.google_ad_frameborder =3D=3D null) {=0A=
  google_ad_frameborder =3D 0;=0A=
}=0A=
=0A=
if (window.google_ad_output =3D=3D null) {=0A=
  google_ad_output =3D 'html';=0A=
}=0A=
=0A=
if (window.google_ad_format =3D=3D null && window.google_ad_output =
=3D=3D 'html') {=0A=
  google_ad_format =3D google_ad_width + 'x' + google_ad_height;=0A=
}=0A=
=0A=
if (window.google_page_url =3D=3D null) {=0A=
  google_page_url =3D document.referrer;=0A=
  if (window.top.location =3D=3D document.location) {=0A=
    google_page_url =3D document.location;=0A=
    google_last_modified_time =3D Date.parse(document.lastModified) / =
1000;=0A=
    google_referrer_url =3D document.referrer;=0A=
  }=0A=
} else {=0A=
  google_page_location =3D document.referrer;=0A=
  if (window.top.location =3D=3D document.location) {=0A=
    google_page_location =3D document.location;=0A=
  }=0A=
}=0A=
=0A=
google_show_ad();=0A=
=0A=
=0A=

------=_NextPart_000_012B_01C4D7EE.0E2DB000
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_0138_01C4D7EE.0E2DB000"


------=_NextPart_001_0138_01C4D7EE.0E2DB000
Content-Type: text/html;
	charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.51one.net/info/4906443418885646.htm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>=C1=D0=BE=D9IE=C8=AB=B2=BFElement=B5=C4=B4=FA=C2=EB - =
- Visual C++- =D6=D0=B9=FA=C2=DB=CC=B3=CD=F8 - =CD=F8=C2=E7=D1=A7=D4=BA =
[www.51one.net]</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META =
content=3D=D6=D0=B9=FA=C2=DB=CC=B3=CD=F8=A3=AC=CD=F8=C2=E7=D1=A7=D4=BA=A3=
=AC=B5=E7=C4=D4=BD=CC=B3=CC name=3Ddescription>
<META =
content=3D=D6=D0=B9=FA=C2=DB=CC=B3=CD=F8=A3=AC=CD=F8=C2=E7=D1=A7=D4=BA=A3=
=AC=B5=E7=C4=D4=BD=CC=B3=CC name=3DKeywords>
<STYLE>TD {
	FONT-SIZE: 9pt; LINE-HEIGHT: 140%
}
BODY {
	FONT-SIZE: 9pt; LINE-HEIGHT: 140%
}
A:link {
	COLOR: #0033cc; TEXT-DECORATION: none
}
A:visited {
	COLOR: #0033cc; TEXT-DECORATION: none
}
A:active {
	COLOR: #ff0000; TEXT-DECORATION: none
}
A:hover {
	COLOR: #000000; TEXT-DECORATION: underline
}
</STYLE>

<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff leftMargin=3D0 =
topMargin=3D0><NOSCRIPT><IFRAME=20
src=3D"http://www.51one.net/1012817/topad.htm"></iframe></IFRAME></NOSCRI=
PT>
<SCRIPT language=3Djavascript =
src=3D"http://www.51one.net/in_top2.js"></SCRIPT>

<DIV align=3Dcenter>
<CENTER>
<SCRIPT language=3Djavascript=20
src=3D"http://www.51one.net/1012817/top750.js"></SCRIPT>

<TABLE width=3D750 background=3Dhttp://www.51one.net/image/bt1.gif>
  <TBODY>
  <TR>
    <TD height=3D10></TD></TR></TBODY></TABLE>
<TABLE style=3D"BORDER-COLLAPSE: collapse" cellSpacing=3D0 =
cellPadding=3D0 width=3D750=20
border=3D0>
  <TBODY>
  <TR>
    <TD width=3D"100%">=C4=FA=B5=C4=CE=BB=D6=C3=A3=BA<A=20
      =
href=3D"http://www.51one.net/index.htm"><B>=D6=D0=B9=FA=C2=DB=CC=B3=CD=F8=
</B></A>-&gt; <A=20
      =
href=3D"http://www.51one.net/info/index.htm"><B>=CD=F8=C2=E7=D1=A7=D4=BA<=
/B></A><B>-&gt; <A=20
      href=3D"http://www.51one.net/info/202_1.htm">Visual =
C++</A></B>-&gt;=20
      =
<B>=C1=D0=BE=D9IE=C8=AB=B2=BFElement=B5=C4=B4=FA=C2=EB</B></TD></TR></TBO=
DY></TABLE></CENTER></DIV>
<DIV align=3Dcenter>
<CENTER>
<TABLE width=3D750 background=3Dhttp://www.51one.net/image/bt1.gif>
  <TBODY>
  <TR>
    <TD height=3D10></TD></TR></TBODY></TABLE>
<TABLE style=3D"BORDER-COLLAPSE: collapse" borderColor=3D#111111 =
cellSpacing=3D0=20
cellPadding=3D0 width=3D750 border=3D0>
  <TBODY>
  <TR>
    <TD vAlign=3Dtop width=3D577 height=3D2>
      <TABLE>
        <TBODY>
        <TR>
          <TD align=3Dmiddle><IFRAME border=3D0 marginWidth=3D0 =
marginHeight=3D0=20
            src=3D"http://www.51one.net/1012817/articleads468.htm" =
frameBorder=3Dno=20
            width=3D468 scrolling=3Dno height=3D60></IFRAME></TD></TR>
        <TR>
          <TD>
            <TABLE width=3D577 =
background=3Dhttp://www.51one.net/image/bt1.gif>
              <TBODY>
              <TR>
                <TD =
height=3D10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
      <TABLE style=3D"TABLE-LAYOUT: fixed; BORDER-COLLAPSE: collapse"=20
      cellSpacing=3D0 cellPadding=3D0 width=3D"100%" border=3D0>
        <TBODY>
        <TR>
          <TD align=3Dmiddle width=3D"100%" bgColor=3D#dfebf4 =
height=3D20><FONT=20
            =
color=3D#004fc6><B>=C1=D0=BE=D9IE=C8=AB=B2=BFElement=B5=C4=B4=FA=C2=EB</B=
></FONT></TD></TR>
        <TR>
          <TD align=3Dmiddle width=3D"100%" bgColor=3D#183ead =
height=3D1></TD></TR>
        <TR>
          <TD width=3D"100%" height=3D2></TD></TR>
        <TR>
          <TD width=3D"100%" height=3D38>
            <P =
align=3Dcenter><B>=D7=F7=D5=DF</B>=A3=BA=D6=D0=B9=FA=C2=DB=CC=B3=CD=F8=CA=
=D5=BC=AF <B>=C0=B4=D4=B4</B>=A3=BAhttp://www.51one.net=20
            <B>=BC=D3=C8=EB=CA=B1=BC=E4</B>=A3=BA2004-8-25 =
=A1=A1</P></TD></TR>
        <TR>
          <TD vAlign=3Dtop width=3D"100%"><FONT style=3D"FONT-SIZE: =
14px"><FONT=20
            color=3D#000000>
            =
<P>//--=C1=D0=BE=D9IE=C8=AB=B2=BFElement=B5=C4=B4=FA=C2=EB</P>
            <P>#include "stdafx.h"</P>
            <P>#pragma warning(disable : 4049)<BR>#pragma =
warning(disable :=20
            4192)<BR>#pragma warning(disable : 4146)</P>
            <P>//#import "shdocvw.dll" =
exclude("tagREADYSTATE")<BR>#import=20
            "shdocvw.dll"<BR>//#import=20
            =
"shdocvw.dll"&nbsp;rename_namespace("SHELL_WINDOW")<BR>//using=20
            namespace=20
SHELL_WINDOW;<BR>#define&nbsp;SHELL_WINDOW&nbsp;SHDocVw</P>
            <P>#include &lt;atlbase.h&gt;<BR>#include=20
            &lt;comdef.h&gt;<BR>#include &lt;MSHTML.H&gt;</P>
            <P>#include &lt;iostream&gt;<BR>using namespace std;</P>
            <P>int IElement(IHTMLDocument2Ptr sp_Doc)<BR>{<BR>&nbsp;int =
ret =3D=20
            0;<BR>&nbsp;CComPtr&lt;IHTMLElementCollection&gt; =
pCollection;</P>
            <P>&nbsp;do {</P>
            <P>&nbsp;&nbsp;cout &lt;&lt; "---list all IE Element---" =
&lt;&lt;=20
            endl;<BR>&nbsp;&nbsp;//--FAILED<BR>&nbsp;&nbsp;//if=20
            =
(!SUCCEEDED(sp_Doc-&gt;get_links(&amp;pCollection)))<BR>&nbsp;&nbsp;if=20
            (!SUCCEEDED(sp_Doc-&gt;get_all(&amp;pCollection)))</P>
            <P>&nbsp; {<BR>&nbsp;&nbsp;&nbsp;cout &lt;&lt; "FAILED." =
&lt;&lt;=20
            endl;<BR>&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;}</P>
            <P>&nbsp;&nbsp;int count =3D 0;<BR>&nbsp;&nbsp;int Count =3D =

            0;<BR>&nbsp;&nbsp;if=20
            =
(!SUCCEEDED(pCollection-&gt;get_length((long*)&amp;Count)))<BR>&nbsp;&nbs=
p;{<BR>&nbsp;&nbsp;&nbsp;cout=20
            &lt;&lt; "FAILED." &lt;&lt;=20
            endl;<BR>&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;}</P>
            <P>&nbsp;&nbsp;for (int i =3D 0; i &lt; Count;=20
            i++)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;_variant_t index =
=3D=20
            long(i);</P>
            <P>&nbsp;&nbsp;&nbsp;CComPtr&lt;IDispatch&gt;=20
            spDispatch;<BR>&nbsp;&nbsp;&nbsp;if=20
            (SUCCEEDED(pCollection-&gt;item(index, index,=20
            =
&amp;spDispatch)))<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;CCom=
Ptr&lt;IHTMLElement&gt;=20
            pElement;<BR>&nbsp;&nbsp;&nbsp;&nbsp;if=20
            =
(SUCCEEDED(spDispatch-&gt;QueryInterface(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;__uuidof(IHTMLElement),=20
            (void=20
            =
**)&amp;pElement)))<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;count=20
            ++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CComBSTR bstr;</P>
            =
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pElement-&gt;get_tagName(&amp;bstr);<BR>=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if=20
            (bstr.Length() &gt; 0) cout &lt;&lt; "tag=3D" &lt;&lt;=20
            (char*)_bstr_t(bstr);// &lt;&lt; endl;</P>
            =
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pElement-&gt;get_innerText(&amp;bstr);<B=
R>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if=20
            (bstr.Length() &gt; 0) cout &lt;&lt; "\ttext=3D" &lt;&lt;=20
            (char*)_bstr_t(bstr) &lt;&lt;=20
            endl;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else cout &lt;&lt; =
"\ttext=3D"=20
            &lt;&lt; endl;</P>
            =
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pElement-&gt;toString(&amp;bstr);<BR>&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;if=20
            (bstr.Length() &gt; 0) cout &lt;&lt; "str=3D" &lt;&lt;=20
            (char*)_bstr_t(bstr) &lt;&lt; endl;</P>
            =
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//pElement-&gt;Release();<BR>&nbsp;&nbsp=
;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;//spDispatch-&gt;Release();<BR>=
&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;//pCollection-&gt;Rel=
ease();<BR>&nbsp;&nbsp;cout=20
            &lt;&lt; "---list count=3D" &lt;&lt; count &lt;&lt; "|" =
&lt;&lt; Count=20
            &lt;&lt; "---" &lt;&lt; endl;</P>
            <P>&nbsp;&nbsp;ret =3D count;<BR>&nbsp;&nbsp;break;</P>
            <P>&nbsp;} while (false);</P>
            <P>&nbsp;return ret;<BR>}</P>
            <P>int main(int argc, char* argv[])<BR>{<BR>&nbsp;cout =
&lt;&lt;=20
            "---test---" &lt;&lt;=20
            =
endl;<BR>&nbsp;<BR>&nbsp;//--COM<BR>&nbsp;CoInitialize(NULL);<BR>&nbsp;<B=
R>&nbsp;do=20
            {<BR>&nbsp;&nbsp;cout &lt;&lt; "---list all IE Window---" =
&lt;&lt;=20
            endl;</P>
            <P>&nbsp;&nbsp;SHELL_WINDOW::IShellWindowsPtr msp_SHWinds =
=3D=20
            NULL;<BR>&nbsp;&nbsp;HRESULT hr =3D=20
            =
msp_SHWinds.CreateInstance(__uuidof(SHELL_WINDOW::ShellWindows));<BR>&nbs=
p;&nbsp;if=20
            (S_OK !=3D hr || NULL =3D=3D=20
            msp_SHWinds)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;cout =
&lt;&lt;=20
            "FAILED." &lt;&lt;=20
            =
endl;<BR>&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;<BR>&nb=
sp;&nbsp;int=20

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -