获取其它进程中的Web Browser中的HTML源码
HWND H1,H2,H3,H4,hw;
H1=H2=H3=H4=hw=NULL;
H1=::FindWindow("TForm1",NULL);
if (H1) H2=::FindWindowEx(H1,NULL,"Shell Embedding",NULL);
if (H2) H3=::FindWindowEx(H2,NULL,"Shell DocObject View",NULL);
if (H3) H4=::FindWindowEx(H3,NULL,"Internet Explorer_Server",NULL);
if (H4) hw=H4;
else
{
AfxMessageBox("No Found the Dialog with IE!");
return;
}
IHTMLDocument2 *pHTMLDocument=NULL;
DWORD lRes;
HRESULT hres;
UINT MSG = RegisterWindowMessage("WM_HTML_GETOBJECT");
SendMessageTimeout(hw, MSG, 0, 0, SMTO_ABORTIFHUNG, 1000, &lRes);
hres=ObjectfromLresult(lRes,__uuidof(IHTMLDocument2),0,(void**)&pHTMLDocument);
if(hres==S_OK)
{
IPersistStreamInit *pPSI=NULL;
IStream *pStream=NULL;
HGLOBAL hHTMLText;
if (FAILED(pHTMLDocument->QueryInterface(&pPSI))) return;
hHTMLText = GlobalAlloc(GMEM_FIXED, 65534);
CreateStreamOnHGlobal(hHTMLText, TRUE, &pStream);
pPSI->Save(pStream, FALSE);
char *pText = (char*)hHTMLText;
FILE *f=fopen("data_from_explorer.txt","w");
fwrite(pText,1,strlen(pText),f);
fclose(f);
AfxMessageBox("the source codes Saved in data_from_explorer.txt");
pStream->Release();
pPSI->Release();
}
相关文档:
HTML有10个表格相关标签。下面是一个带有简介的列表,但是首先,文档要被正确的定义在HTML 4.01/XHTML 1或HTML 5下面:
<caption> 定义表格标题(4, 5)
<col> 为表格的列定义属性(4, 5)
<colgroup> 定义表格列的分组(4, 5)
<table> 定义表格(4, 5)
<tbody> 定义表格主体(4, 5)
< ......
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
Go
----截取字符串,并出去html
create FUNCTION [dbo].[CutString] (@str varchar(1000),@length int)
RETURNS varchar(1000) AS
BEGIN
declare @mainstr varchar(1000)
declare @substr varchar(1000)
if(@str is not null or @st ......
<p>: 格式化段落; <h1>,<h6> 标题; <blockquote>-- 引用的文本; <pre>--预先格式化好的文本;保留原有的格式.
<ol><dl><ul>:顺序列表,定义列表,无标号列表. <li>用以显示单个的元素; <dl><dt><dd></dd></dt><dl>
< ......
摘自:http://www.pconline.com.cn/pcedu/sj/wz/html/0401/293106.html
meta是用来在HTML文档中模拟HTTP协议的响应头报文。meta 标签用于网页的<head>与</head>中,meta 标签的用处很多。meta 的属性有两种:name和http-equiv。name属性主要用 ......