[BCB]如何清除網站瀏覽記錄

有關於C/C++的語法, 程式等
回覆文章
頭像
tim
文章: 1380
註冊時間: 2008年 11月 26日, 00:49

[BCB]如何清除網站瀏覽記錄

文章 tim »

http://delphi.ktop.com.tw/topic.asp?TOPIC_ID=36723

代碼: 選擇全部

     
    #include "urlhist.h" 
    #include "objbase.h" 
    #include "shlguid.h" 
    void __fastcall Tform1::Button1Click(TObject *Sender) 
    { 
       HRESULT hr=S_FALSE; 
       IUrlHistoryStg2* pUrlHistoryStg2=NULL; 
     
       CoInitialize(NULL); 
       hr=CoCreateInstance(CLSID_CUrlHistory, NULL, CLSCTX_INPROC, 
          IID_IUrlHistoryStg2, (void**)&pUrlHistoryStg2); 
       if(SUCCEEDED(hr)) 
       { 
          hr=pUrlHistoryStg2->ClearHistory(); 
          if(SUCCEEDED(hr)) 
          { 
             ShowMessage("Clear IE History succeeded!"); 
          } 
          else 
          { 
             ShowMessage("Clear IE History failed!"); 
          } 
          pUrlHistoryStg2->Release(); 
       } 
       CoUninitialize(); 
    } 
多多留言, 整理文章, 把經驗累積下來.....
回覆文章