Internet History

Hey folks....
Iv been trawling through the net trying to find a solution to my question, but without any success.
I need to find a simple way of displaying my computors internet history in a memo box. I have seen this question answered on here before, however they all suggest downloading certain components from the net etc.... is there not just a way of doing it in normal code without components?
Note: i dont need it to be fancy, or modify the history in any way.... just a little bit of coding, which when say button1 is pressed, memo1 displays the computors internet history!
Anyhelp is greatly appreciated!

King Regards
James
LVL 2
GreenandroidAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DeerBearCommented:
Hi,

Before posting a question, one should always try and find a way to
solve his/her own problems.

Specifically, looking for history in regedit, you come across this key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

Where you find a value, labelled "history" that points to a folder.
In that folder, you'll find some sub folders you can access to
obtain the data you want.

To list the subfolders, use FindFirst/FindNext/FindClose functions.

HTH,

Andrew
ginsonicCommented:
GreenandroidAuthor Commented:
hmm.....
ok, il start with ginsonic....
ok... well first of all, i am aware of the Turlhistory component, and have already got that component installed on my computor.....however as i previously mentioned, ideally i need just a bit of code to add the history to a simple memo box.... The problem with the tUrlHitory component is that it seems to work perfectly in its examples, but seems to 'rip itself to pieces' when i try to get it to display the urls in a memo box.....
Il quite happily give you the points if you could give me a SMALL piece of code, using that component, that JUST adds the urls from the history folder to a memo upon the click of a button.... the demos included with tUrlHistory are much more advanced than i need (displaying dates etc) - a simple list of urls is all i need!

Now to deerbea.....
You say that 'one should not post until one has tried solving it themselves' - Well to be honest, i wouldnt be posting my question on here unless i had previously tried it, and got nowhere! Now to your comment..... I am aware that you can do it through the registry keys, however i must admit, i do not have any experience in this area at all. I have never had to use the registry in any of my applications before, which is why i would need further guidence. If, like you said, its possible through the key you mentioned, please could you write a small code which will do as i said? (Press a button and the list of urls from the history is displayed in a memo box!)
As with ginsin, i'd quite happily give you the points if you could do that!

Well thanks for the comments so far anyway, and im looking forwards to hearing back from you all!
Kind Regards
James
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

DeerBearCommented:
Hi,

I had a test on it, to see if needed recursion and so on, but it
seems impossible to be done via "normal" code due to the
strange behaviour of the folder under DOS and Windows.

Thus, I devoted my attention to the History component, and I
though of a way to do it with that one:

Just issue a "DeleteHistory" handling the "OnDelete" event.
When you're in there, just add the URL to the memo and set
"Delete" to false to preserve it.

HTH,

Andrew
GreenandroidAuthor Commented:
sorry, but please could you explain a little more in depth on what you mean....
Is this using the tUrlHistory component?

Also, please could you explain in a more step to step guide for me.... im not that used to the terms you use fro delphi, as i am newer to delphi than any other language i know... sorry to be a bit of a pain!

Kind Regards
James
GreenandroidAuthor Commented:
Well thank god for that!!!

Iv just managed to get it to work perfectly for what i needed, and all i needed to use was the urlhistory component, and arrays!

Just to put you all out your misery, this is how simple it really was!
--------------------------------------------------------------------------------------
procedure TForm1.Button1Click(Sender: TObject);
var
  count, total: Integer;
begin
  Total:=UrlHistory1.Enumerate;
  For count:=0 to Total-1 do
    begin
       memo1.Lines.Add(PEntry(Urlhistory1.Items[count]).Url);
    end;
end;
--------------------------------------------------------------------------------------

Looks so simple once you've worked it out!
I think il still try and give you both some points if i work out how, just for pointing me in the kinda right direction.... Thanks for all your help!
DeerBearCommented:
Hi,

Yes, I examined the possibility to walk through the entries via
plain code, but I noticed it was very difficult to do.

Thus, I explored the TUrlHistory component, to see if it was easier to
accomplish.

According to its documentation there's an event called "OnDelete"
that gets called each time you are going to delete an URL from history.

Its format is:

OnDelete(Title, Url: String; LastVisited, LastUpdated, Expires: TDateTime;
var Delete: Boolean);

Now, according to this prototype, you can see the Delete parameter
that can be changed. A value of True means "go on deleting" and a
value of False means "do not delete".

If you examine the documentation further, you'll see a method called

DeleteEntries

Which( according to documentation ) deletes all entries from the history
list.

IF the documentation is complete, this means that calling DeleteEntries will
issue as many OnDelete events as the number of items in the history list.

If you examine well the OnDelete event, you'll notice a parameter called
URL that, according to the documentation, contains the URL about to be
deleted.

This means that calling DeleteEntries will, among other things, iterate the
history list reporting each and every url in it.

This means you can do something like this

procedure MyForm.MyUrlDelete(Title, Url: String; LastVisited,LastUpdated,
Expires: TDateTime; var Delete: Boolean);
begin
   URLMemo.Lines.Add( Url );
   Delete := False;
end;

and call from your button:

procedure MyForm.MyButtonClick( Sender: TObject );
begin
   MyUrl.DeleteEntries;
end;

Now, if you place on your form a memo component naming it MyMemo,
name the form "MyForm" and the button you'll place "MyButton",
pasting the above code will display the URLs directly in the memo.

HTH,

Andrew

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GreenandroidAuthor Commented:
Thanks again guys...
let me explain what i have done for you quickly!

Well i managed to solve the problem myself (read above)....HOWEVER i wished to thank you guys for helping me, and so have given you the points anyway!

I have given ginsonic 20 points for suggesting a component (which i already had) but helped with DeerBears answers :P

I have given you the remaining 80 points DeerBear, as you have typed an awful lot, and hope its some reward to your aching fingers :P

Kind regards!
James
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.