在自己的应用程序中清除IE的历史记录,源码如下:
#include <UrlHist.h> // Delete all items in History folder HRESULT ClearHistory() { IUrlHistoryStg2* pUrlHistoryStg2 = NULL; HRESULT hr = CoCreateInstance(CLSID_CUrlHistory, NULL, CLSCTX_INPROC, IID_IUrlHistoryStg2, (void**)&pUrlHistoryStg2); if (SUCCEEDED(hr)) { hr = pUrlHistoryStg2->ClearHistory(); pUrlHistoryStg2->Release(); } return hr; }