Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4625423
  • 博文数量: 671
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 7310
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-14 09:56
文章分类

全部博文(671)

文章存档

2011年(1)

2010年(2)

2009年(24)

2008年(271)

2007年(319)

2006年(54)

我的朋友

分类: C/C++

2008-02-18 15:59:56

 

Do you want to have a feature (in your own application) of "Clear History" like IE5 does in its "Internet Options"?

Here is how you can do it. It's not documented, but I have tested it and it works, with VC++ 6.0 and Win98/NT.


#include 
// 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;
}

阅读(628) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~