📄 列举ie全部element的代码.mht
字号:
' 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>-> <A=20
=
href=3D"http://www.51one.net/info/index.htm"><B>=CD=F8=C2=E7=D1=A7=D4=BA<=
/B></A><B>-> <A=20
href=3D"http://www.51one.net/info/202_1.htm">Visual =
C++</A></B>->=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" rename_namespace("SHELL_WINDOW")<BR>//using=20
namespace=20
SHELL_WINDOW;<BR>#define SHELL_WINDOW SHDocVw</P>
<P>#include <atlbase.h><BR>#include=20
<comdef.h><BR>#include <MSHTML.H></P>
<P>#include <iostream><BR>using namespace std;</P>
<P>int IElement(IHTMLDocument2Ptr sp_Doc)<BR>{<BR> int =
ret =3D=20
0;<BR> CComPtr<IHTMLElementCollection> =
pCollection;</P>
<P> do {</P>
<P> cout << "---list all IE Element---" =
<<=20
endl;<BR> //--FAILED<BR> //if=20
=
(!SUCCEEDED(sp_Doc->get_links(&pCollection)))<BR> if=20
(!SUCCEEDED(sp_Doc->get_all(&pCollection)))</P>
<P> {<BR> cout << "FAILED." =
<<=20
endl;<BR> break;<BR> }</P>
<P> int count =3D 0;<BR> int Count =3D =
0;<BR> if=20
=
(!SUCCEEDED(pCollection->get_length((long*)&Count)))<BR> &nbs=
p;{<BR> cout=20
<< "FAILED." <<=20
endl;<BR> break;<BR> }</P>
<P> for (int i =3D 0; i < Count;=20
i++)<BR> {<BR> _variant_t index =
=3D=20
long(i);</P>
<P> CComPtr<IDispatch>=20
spDispatch;<BR> if=20
(SUCCEEDED(pCollection->item(index, index,=20
=
&spDispatch)))<BR> {<BR> CCom=
Ptr<IHTMLElement>=20
pElement;<BR> if=20
=
(SUCCEEDED(spDispatch->QueryInterface(<BR> &nbs=
p;__uuidof(IHTMLElement),=20
(void=20
=
**)&pElement)))<BR> {<BR> &nb=
sp; count=20
++;<BR> CComBSTR bstr;</P>
=
<P> pElement->get_tagName(&bstr);<BR>=
if=20
(bstr.Length() > 0) cout << "tag=3D" <<=20
(char*)_bstr_t(bstr);// << endl;</P>
=
<P> pElement->get_innerText(&bstr);<B=
R> if=20
(bstr.Length() > 0) cout << "\ttext=3D" <<=20
(char*)_bstr_t(bstr) <<=20
endl;<BR> else cout << =
"\ttext=3D"=20
<< endl;</P>
=
<P> pElement->toString(&bstr);<BR>&nb=
sp; if=20
(bstr.Length() > 0) cout << "str=3D" <<=20
(char*)_bstr_t(bstr) << endl;</P>
=
<P> //pElement->Release();<BR>  =
; }<BR> //spDispatch->Release();<BR>=
}<BR> }<BR> //pCollection->Rel=
ease();<BR> cout=20
<< "---list count=3D" << count << "|" =
<< Count=20
<< "---" << endl;</P>
<P> ret =3D count;<BR> break;</P>
<P> } while (false);</P>
<P> return ret;<BR>}</P>
<P>int main(int argc, char* argv[])<BR>{<BR> cout =
<<=20
"---test---" <<=20
=
endl;<BR> <BR> //--COM<BR> CoInitialize(NULL);<BR> <B=
R> do=20
{<BR> cout << "---list all IE Window---" =
<<=20
endl;</P>
<P> SHELL_WINDOW::IShellWindowsPtr msp_SHWinds =
=3D=20
NULL;<BR> HRESULT hr =3D=20
=
msp_SHWinds.CreateInstance(__uuidof(SHELL_WINDOW::ShellWindows));<BR>&nbs=
p; if=20
(S_OK !=3D hr || NULL =3D=3D=20
msp_SHWinds)<BR> {<BR> cout =
<<=20
"FAILED." <<=20
=
endl;<BR> break;<BR> }<BR> <BR>&nb=
sp; int=20
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -