Getting the History from Internet Explorer
Posted
by Akash Kava
on October 2nd, 2002
Click here for a larger image.
Environment: VC6
[ #include <atlbase.h> #include <comdef.h> #include <mshtml.h> #include <UrlHist.h> #include <afxtempl.h> BOOL GetHistory(CStringList & list) { STATURL url; CString strUrl; ULONG uFetched; IUrlHistoryStg2Ptr history; IEnumSTATURLPtr enumPtr; if(FAILED(CoCreateInstance(CLSID_CUrlHistory, NULL, CLSCTX_INPROC_SERVER, IID_IUrlHistoryStg2, ( void**)&history))) { return false ; } if(FAILED(history->EnumUrls(&enumPtr))) return false; while(SUCCEEDED(enumPtr->Next(1,&url,&uFetched))) { if(uFetched==0) break; strUrl = url.pwcsUrl; list.AddTail(strUrl); } return true; } ]
Downloads
Download demo project - 28 KbDownload source - 11 Kb