|
发表于 2009-1-21 16:41:11
|
显示全部楼层
http://topic.csdn.net/t/20020718/16/884415.html
通过写个程序可以实现,MS还是提供了接口的
VARIANT vDummy = {0};
// Instantiate a browser
if (FAILED(hr = CoCreateInstance(CLSID_InternetExplorer,
NULL, CLSCTX_SERVER, IID_IWebBrowser2,
(LPVOID*)&pWebBrowser)))
{
goto Error;
}
// Show the browser, and navigate to the special location
// represented by the pidl
hr = pWebBrowser->put_Visible(VARIANT_FALSE);
hr = pWebBrowser->Navigate2(&vPIDL, &vDummy, &vDummy,
&vDummy, &vDummy);
或:
#include <urlhist.h>
BOOL AddHistory()
{
IUrlHistoryStg * purlhistorystg=NULL;
//???com?
CoInitialize(NULL);
//??????
HRESULT hr=CoCreateInstance(CLSID_CUrlHistory,NULL,CLSCTX_INPROC,IID_IUrlHistoryStg,(void**)&purlhistorystg);
if(SUCCEEDED(hr))
{
//????
if(SUCCEEDED(hr))
{
WCHAR url[200];
ZeroMemory(url, sizeof(url));
WCHAR title[200];
ZeroMemory(title, sizeof(title));
MultiByteToWideChar(CP_ACP,NULL,"http://www.555.com/",strlen("http://www.555.com/"),url,sizeof(url));
MultiByteToWideChar(CP_ACP,NULL,"(敏感词0386)ing 555",strlen("(敏感词0386)ing 555"),title,sizeof(title));
hr=purlhistorystg->AddUrl(url, title,0);
// hr=purlhistorystg->AddRef();
if(S_OK !=hr)
return FALSE;
}
purlhistorystg->Release();
}
//??com????
CoUninitialize();
return TRUE;
}
查看相关MSDN,至少能证明MS提供了接口,通过编写特定的程序,是可以向IE添加历史记录的 |
|