/// <summary>
 /// Advances the enumerator to the next item of the url history cache.
 /// </summary>
 /// <returns>true if the enumerator was successfully advanced to the next element;
 ///  false if the enumerator has passed the end of the url history cache.
 ///  </returns>
 public bool MoveNext()
 {
     _staturl = new STATURL();
     _enumerator.Next(1, ref _staturl, out _index);
     if (_index == 0)
     {
         return(false);
     }
     return(true);
 }
 /// <summary>
 ///Enumerate the items in the history cache and store them in the IList object.
 /// </summary>
 /// <param name="list">IList object
 /// <example><c>ArrayList</c>object</example>
 /// </param>
 public void GetUrlHistory(IList list)
 {
     while (true)
     {
         _staturl = new STATURL();
         _enumerator.Next(1, ref _staturl, out _index);
         if (_index == 0)
         {
             break;
         }
         //if (_staturl.URL.StartsWith("http"))
         list.Add(_staturl);
     }
     _enumerator.Reset();
 }
        /// <summary>
        ///Queries the history and reports whether the URL passed as the pocsUrl parameter has been visited by the current user.
        /// </summary>
        /// <param name="pocsUrl">the string of the URL to querythe string of the URL to query.</param>
        /// <param name="dwFlags">STATURL_QUERYFLAGS Enumeration
        /// <example><c>STATURL_QUERYFLAGS.STATURL_QUERYFLAG_TOPLEVEL</c></example></param>
        /// <returns>Returns STATURL structure that received additional URL history information. If the returned  STATURL's pwcsUrl is not null, Queried URL has been visited by the current user.
        /// </returns>
        public STATURL QueryUrl(string pocsUrl, STATURL_QUERYFLAGS dwFlags)
        {
            var lpSTATURL = new STATURL();

            try
            {
                //In this case, queried URL has been visited by the current user.
                obj.QueryUrl(pocsUrl, dwFlags, ref lpSTATURL);
                //lpSTATURL.pwcsUrl is NOT null;
                return(lpSTATURL);
            }
            catch (FileNotFoundException)
            {
                //Queried URL has not been visited by the current user.
                //lpSTATURL.pwcsUrl is set to null;
                return(lpSTATURL);
            }
        }