Clear History Functionality (like IE5)

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:49pm

    Just include shlwapi.h to your app, and it will work. At least it did on my pos computer running windows 98 se.

    Reply
  • How to get IHTMLDOCUMENT2 ?

    Posted by Legacy on 02/11/2004 12:00am

    Originally 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

    Reply
  • welcome

    Posted by Legacy on 09/16/2003 12:00am

    Originally posted by: xyz

    testing hia

    Reply
  • WSS Devise Properties functionality

    Posted by Legacy on 05/02/2003 12:00am

    Originally posted by: Jeff

                                                                                                                                        Somehow, the devise for my windows sound system has become disabled, causing my computers ability to produce sound through its normal pathway, which is accessed in the back of the computer. Or, actually where you would normally plug your speakers in at. I know my sound card is good because I can access sound by plugging the speakers into a jack which is located in the front of my computer, which was designed for plugging headphones into.                                                                   When I go to system properties, and look under devise manager, for "sound, video and game controlers", the dropdown menu shows that the (WSS)Devise status has stopped responding, and indicates a Code 11.  Also says, for more information look up ASD in Windows Help. I did that and it shows that there are five drivers installed for this devise, and that they are working and there is no conflict showing up under the driver resourses tab. The computer is a CyrixInstead, I am using Windows 98 SE, which replaces the older Windows 95 which was on it before the problem started, and this devise was working prior to changeing to Win 98 SE. I have looked this up in the windows help index and have not gotten anywhere with it. Does anyone have any ideas as how to turn this pathway back on so I can use the functions it provides for this computer. Thanks  
    

    Reply
  • Is it possible in Visual dialogScript

    Posted by Legacy on 03/13/2003 12:00am

    Originally posted by: ASD

    I wonder if it is possible in visual dialogscript to delete history.

    Reply
  • Doesn't clear all for running instance of IE

    Posted by Legacy on 02/28/2003 12:00am

    Originally 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?

    Reply
  • IUrlHistoryStg(2) is not supported in version less than ME!

    Posted by Legacy on 02/05/2003 12:00am

    Originally posted by: briball

    Microsoft reports that these two interfaces (they are
    COM 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...

    Reply
  • Don't forget to call AfxOleInit() in your App InitInstance()

    Posted by Legacy on 11/25/2002 12:00am

    Originally 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).


    Reply
  • Displaying History Entries

    Posted by Legacy on 09/16/2002 12:00am

    Originally 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?

    Reply
  • Full answer to all my questions -- Found

    Posted by Legacy on 08/28/2002 12:00am

    Originally posted by: Jim Parsells

    The entire answer to all of my questions, and most others
    
    in this thread is located at:

    http://codeguru.earthweb.com/mfc/comments/16965.shtml

    Unfortunately, there are no other links to it from the
    IE Programming topic.

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • Relying on outside companies to manage your network and server environments for your business and applications to meet the needs and demands of your users can be stressful. This is especially true as many Managed Hosting organizations fail to meet their service level agreements. Read this Forrester total economic impact report and learn what makes INetU different and how they exceed their customers' managed hosting expectations.

Most Popular Programming Stories

More for Developers

RSS Feeds