Clear History Functionality (like IE5)
Posted
by Peter Sun
on December 16th, 1999
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 <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;
}

Comments
Fix for Computers Before XP
Posted by canopener4000 on 09/05/2005 08:49pmJust include shlwapi.h to your app, and it will work. At least it did on my pos computer running windows 98 se.
ReplyHow to get IHTMLDOCUMENT2 ?
Posted by Legacy on 02/11/2004 12:00amOriginally posted by: anjali
Hi All
Maybe somebody can help me.
...
if(SUCCEEDED(m_spWebBrowser2->get_Document(&pDisp)))
{
IHTMLDocument2* pHtmlDocument;
if(SUCCEEDED(pDisp->QueryInterface(IID_IHTMLDocument2,
(void**)&pHtmlDocument)))
...
}
right, i can get a pointer of IHTMLDocument2 and manage it
if it is single document.
but how to get multiple document pointer?(when using frame tag in html file i'd like to get pointers of the documents for each frame )
thanks
Replywelcome
Posted by Legacy on 09/16/2003 12:00amOriginally posted by: xyz
testing hia
ReplyWSS Devise Properties functionality
Posted by Legacy on 05/02/2003 12:00amOriginally posted by: Jeff
ReplyIs it possible in Visual dialogScript
Posted by Legacy on 03/13/2003 12:00amOriginally posted by: ASD
I wonder if it is possible in visual dialogscript to delete history.
ReplyDoesn't clear all for running instance of IE
Posted by Legacy on 02/28/2003 12:00amOriginally posted by: Tim
There appears to be a problem with this code as it does not remove the dropdown history of any browsers that are running at the time. I have tried removing the registry settings at HKEY_CURRENT_USER,"Software\\Microsoft\\Internet Explorer\\Typed URLs\\" and the entry goes away, however the IE application that is running still shows the history int he dropdown. (I think for just the typed ones). (Running XP home)
Any suggestions?
ReplyIUrlHistoryStg(2) is not supported in version less than ME!
Posted by Legacy on 02/05/2003 12:00amOriginally posted by: briball
Microsoft reports that these two interfaces (they are
ReplyCOM interfaces, if you didn't know already) are
supported by ME and 2000. Since the article came out
before XP, I'm guessing XP supports it too. Win 9x, I
guess we miss out...
Don't forget to call AfxOleInit() in your App InitInstance()
Posted by Legacy on 11/25/2002 12:00amOriginally posted by: Francis Leca
This nice little piece of code is based on OLE (UrlHist.h includes ole2.h).
Including AfxOleInit() in your application InitInstance()sets the task memory allocator used by OLE. If not done, OLE cannot perform memory allocations and any OLE calls will fail.
See also Akash Kava's comment under his excellent and recent contribution entitled "Getting the History from Internet Explorer" (CodeGuru, same section).
ReplyDisplaying History Entries
Posted by Legacy on 09/16/2002 12:00amOriginally posted by: Gaelen Burns
I'm interested in having my application display the browsing history of the computer it's run on. I can do all the other browsers, 'cuz they store they're URL cache in a less obfuscated manner, but I need help with IE.
Can anyone give me some hints?
ReplyFull answer to all my questions -- Found
Posted by Legacy on 08/28/2002 12:00amOriginally posted by: Jim Parsells
ReplyLoading, Please Wait ...