How to Get ie history and clear ie history

Source: Internet
Author: User
Related interfaces: iurlhistorystg, ienumstaturl, iurlhistorystg2 related methods: Iurlhistorystg: enumurlsThis method returns an ienumstaturl interface pointer, which is used to enumerate ie history records. Lresult Ienumstaturl :: Next (ulong Celt, lpstaturl rgelt, ulong * pceltfetched) Parameter description: CeltThe value cannot be 0, but can be set to 1. RgeltIs a staturl structure pointer that is filled by a MS-IE. PceltfetchedReturned by the method. 1 indicates that the rgelt structure is successfully filled. To use the data in the second parameter, you should determine whether the value is 1. Header file: urlhist. h The following is a code example (required header file: comdef. h, afxtempl. h): bool gethistory (cstringlist & list) {staturl URL; cstring strurl; ulong ufetched; invalid history; ienumstaturlptr enumptr; If (failed (cocreateinstance (temperature, null, temperature, (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;} another useful method: Lresult ienumstaturl: setfilter (lpcolestr poszfilter, DWORD dwflags );You can call this method to set the filter before calling next enumeration history. How should I set poszfilter? Determine whether the URL matches poszfilter completely or the prefix. For example, enumptr-> setfilter (L "HTTP", staturl_queryflag_iscached); then the recorded URL is enumerated by next only when it starts with HTTP. Set poszfilter to RES and file to get different types of URLs. Another method: ClearhistoryYou can call this operation to clear all historical records, but note that this method belongs to the iurlhistorystg2 interface.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.