我们只要调用如下ClearHistory函数就可以删除IE的历史记录
#include <wininet.h>
#include <UrlHist.h>
#include <SHLGUID.H>
#include <OBJBASE.H>
HRESULT ClearHistory()
{
HRESULT hr;
CoInitialize(NULL);
{
IUrlHistoryStg2* pUrlHistoryStg2 = NULL;
hr= CoCreateInstance(CLSID_CUrlHistory,NULL,1, IID_IUrlHistoryStg2,(void**)&pUrlHistoryStg2);
if (SUCCEEDED(hr))
{
hr = pUrlHistoryStg2->ClearHistory();
pUrlHistoryStg2->Release();
}
}
CoUninitialize();
return hr;
}
>> 本文固定链接: http://www.vcgood.com/archives/855